linux - GNU screen: change focus in split windows with mouse

07
2014-07
  • Enrico

    Is there a way to enable proper mouse support in GNU screen so that I can switch the focus between split windows using my mouse?

    In other words, I'm looking for a mouse-driven alternative to typing 'C-a Tab'.

    Thanks,

  • Answers
  • Alexej Magura

    I believe that GNU Screen's upstream may have proper mouse support. See Mouse in screen(1) on the Linux console?.

    Also check Debian Sid (unstable), since according to the first answer found for the said post, Debian Unstable has the latest version/release thingy of GNU Screen.

    This, however, may mean that you'll have to build Screen from source, which in of itself shouldn't be too difficult, but if you've never done this kind of thing before it can be a bit intimidating.

  • RPDiep

    GNU screen does not use the mouse in any way.
    If you want that behaviour, you could try tmux instead. To enable that behaviour in tmux, add the following line to ~/.tmux.conf :

    set -g mouse-select-pane on
    
  • TheNobleSunfish

    One can add

    mousetrack on
    

    to ~/.screenrc


  • Related Question

    Resize GNU screen windows with a mouse
  • Questioner

    I love the way I can resize windows in vim using the mouse.

    Is it possible to do the same in GNU screen? If not, is there an alternative to screen that supports this functionality?


  • Related Answers
  • Roy Rico

    I use screen all the time, and change the window size effortlessly, without an issue. It's whatever command is running inside the screen that needs to be able to resize as well.

  • whallify

    I agree with Roy - I resize windows all the time, and I only run things in screen. In fact, I can't think of the last time I kept a terminal up for more than 1 minute that wasn't running screen permanently.

    Even with Putty from a windows box, it works.

    Even with Putty from a windows box, ssh'ed into localhost running cygwin/sshd, running screen, it works.

    Maybe there's something in your .screenrc or even your shell's .rc file that's preventing resize?

  • Firefeather

    I think Terminator is probably what you're looking for.

    Note that I've never used GNU Screen or Terminator, so I'm relying on the following information:

    1. According to the intro to the Wikpedia article about GNU Screen, it's main purpose is for showing "multiple separate terminal sessions inside a single terminal window".
    2. The header on Terminator's site on Launchpad says, "the main focus is arranging terminals in grids".
    3. The screenshots seem to be displaying similar features.
    4. I've read a little bit in passing when they've been mentioned on blogs, and heard a bit in podcast segments. My memory of what they said is also in agreement with the answer.
  • bignose

    GNU screen is completely oblivious of the mouse.

    As is Vim, when it's running within a TTY emulator.

  • Raphael Jolivet

    I guess you are talking about resizing the split areas inside a window. I agree that this is possible to do it in VIM with the mouse. This is very handy.

    I also would like this feature for gnu screen.

    In the meantime, I recommend you to try the sweet extension Vim-shell, which enables you to have native shells embedded in VIM.

    It's too bad it is no more maintained or merged within Vim itself. You will have to compile it by hand on an older version of VIM (7.0).

  • studiohack

    X Window, by itself, generates borderless windows in fixed screen locations. It requires a "window manager" to add borders and buttons and the ability for users to resize and move the windows on screen. The Tabbed Window Manager (twm) has been the default X window manager, but more than three dozen others have been used, including AfterStep, Blackbox and Enlightenment. The KDE and GNOME user interfaces for Linux use Kwin and Metacity respectively as their window managers.

    Source: http://encyclopedia2.thefreedictionary.com/X+Window

  • Diogo

    I think Tmux knows about the mouse:

    tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.