'reset' sets window to 80 columns

130 views
Skip to first unread message

Sandman

unread,
Jan 25, 2011, 1:14:24 PM1/25/11
to iterm2-discuss
Whenever I type 'reset' in an iTerm 2 window, this resets the number
of columns to 80, regardless of what it was set to before and
regardless of what is default. Is this intended behavior ?

George Nachman

unread,
Jan 25, 2011, 4:12:19 PM1/25/11
to iterm2-...@googlegroups.com
You can disable window resizing in preferences->bookmarks->terminal->disable session-initiated window resizing. The 'reset' command is supposed to restore the window to 80 or 120 columns.

Chris Welsh

unread,
Jan 26, 2011, 1:46:43 PM1/26/11
to iterm2-...@googlegroups.com
Ahh - that's been annoying me too - when I use the screen command to bring up a terminal session I had the same problem - this has fixed it. thanks.

Bjornar Sandvik

unread,
Jan 28, 2011, 12:54:40 AM1/28/11
to iterm2-...@googlegroups.com
Thanks, that did fix the problem. However, now the reset command doesn't work in the teminal. Since when is "reset" supposed to change the columns to 80 anyway ? I don't think any other Terminal app I've ever had does that.

George Nachman

unread,
Jan 28, 2011, 12:58:48 AM1/28/11
to iterm2-...@googlegroups.com
Ah, good old Issue 1! The relevant bit:


Hm, it looks like the code we get is esc [ ? 3;4l
It's hard to find documentation on this. It looks like esc [ ? 3 is DEC Private Mode Reset columns:
http://vt100.net/docs/vt100-ug/chapter3.html
and the ;4 is ignored, and the command is DECCOLM:
http://vt100.net/docs/vt510-rm/DECCOLM
Which is supposed to do this:

DECCOLM sets the number of columns on the page to 80 or 132 and selects the corresponding 80- or 132-column font.
If you change the DECCOLM setting, the terminal:
Sets the left, right, top and bottom scrolling margins to their default positions.
Erases all data in page memory.
DECCOLM resets vertical split screen mode (DECLRMM) to unavailable.
DECCOLM clears data from the status line if the status line is set to host-writable.

Now, whether we should respect the standard is a separate question. But since you can turn off resizing, I'm inclined to err on the side of the standard.

Pelle Johansson

unread,
Jan 28, 2011, 3:52:41 AM1/28/11
to iterm2-...@googlegroups.com

28 jan 2011 kl. 06.54 skrev Bjornar Sandvik:

> Thanks, that did fix the problem. However, now the reset command doesn't work in the teminal. Since when is "reset" supposed to change the columns to 80 anyway ? I don't think any other Terminal app I've ever had does that.

I also find it annoying, since I want to use aliases to change window size but typically not when when using reset. I've learned to always try stty sane first though.

Funilly, reset -c will reset the columns, while reset -w does nothing. That does seem a bug.
--
Pelle Johansson

George Nachman

unread,
Jan 28, 2011, 1:19:36 PM1/28/11
to iterm2-...@googlegroups.com
The reset man page warns that -w usually does nothing, though I don't know enough about setupterm to say if it's a bug:
From the man page:

       -w   Resize  the  window to match the size deduced via setupterm.  Nor-
            mally this has no effect, unless setupterm is not able  to  detect
            the window size.
Reply all
Reply to author
Forward
0 new messages