Resize GNU screen windows with a mouse

16
2013-10
  • 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?

  • 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.


  • Related Question

    osx - GNU screen fails to resize with Snow Leopard xterm
  • genehack

    I use 120x80 xterms under X11 (which I start via xterm -geometry 120x80). I also use some constantly running GNU screen sessions on a couple of different hosts -- both local to the mac and on some remote Linux boxes.

    With Leopard, when I re-connected to an existing screen session, screen would suss out the size of the xterm it was running in and automatically expand to fill it.

    With Snow Leopard, this no longer happens. Re-connecting to a running screen results in it coming up in 80x25. I have to resize the xterm window to get the screen session to expand out. Once I've done that once, I can disconnect and reconnect and screen does the right thing.

    Is there any way to fix this and go back to the old xterm behavior?

    (Snow Leopard does have a new version of xterm:

    $ /usr/X11R6/bin/xterm -v
    XTerm(244)
    

    Versus the version in Leopard:

    $ /usr/X11R6/bin/xterm -v
    X.Org 6.8.99.903(241)
    

    Haven't yet tried copying the Leopard xterm over to Snow Leopard...)


  • Related Answers
  • genehack

    I've been having the same problem. Found the solution on one of the Apple X11-Users list threads. Add this to your ~/.Xdefaults file:

    XTerm*ptySttySize: true

    and restart X11. Worked for me!