-3

On Ubuntu 14.04, MATE desktop. I have just installed Tilda terminal, and so I added it to Startup Applications, just as /usr/bin/tilda. Rebooted, saw Tilda startup, and then noticed this:

tilda

"Your 131072x1 screen size is bogus. expect trouble"

Then I tried killall tilda, started tilda again, same message.

Anyone know how can I fix this bogus screen size issue?

sdbbs
  • 480
  • 1
    I believe this message is thrown by shopt -s checkwinsize somewhere in your .bashrc or the system's bashrc. I think I also had this warning with geany. Not anymore. –  May 20 '16 at 09:17
  • Thanks @Nasha - checkwinsize seems like a useful option, so I wouldn't like to remove it; but maybe there\s a way to disable that check only for when Tilda is loaded... – sdbbs May 20 '16 at 09:40
  • Instead of taking the time to edit your prompt, you could have provided the message as text. Or even better: just google the error message and find the post Thomas' indicates as the first result – Anthon May 21 '16 at 05:32
  • Sorry for that, I stopped reading when I saw the picture and realised you could have saved everyone’s trouble by using google. – Anthon May 21 '16 at 05:43
  • @Anthon - I did provide the message as text; Ctrl-F it: "Your 131072x1 screen size is bogus. expect trouble"; also I find the answer of JdeBP here much more informing. – sdbbs May 21 '16 at 05:43

1 Answers1

-1

What is generating this message

This is not produced by the Bourne Again shell. This is not produced by Tilda.

This is produced by the ps command from the procps toolset performing this check in its set_screen_size() function. The ps command demands that your terminal device be a minimum of 9 columns by 2 rows in order for it to be able to display things reasonably. Somewhere, possibly unbeknownst to you, you are invoking ps.

The ps command obtains your terminal size directly from (the line discipline of) the terminal device attached to its standard I/O file descriptors, and allows that to be overridden by COLUMNS and LINES environment variables if their values are properly numeric. You can see what your ps command is seeing in order to make its determination by running:

stty size ; printenv COLUMNS LINES
You can experiment with pulling ps's leg by running things such as:
COLUMNS=65535 LINES=1 ps

If you have set the COLUMNS and LINES environment variables to the daft 131072×1 values, as shown by the output of printenv, then simply do not do that. ☺ It is more probable however that the terminal device itself is reporting this size, which you will see from the output of stty. (Note that all that the Bourne Again shell does with checkwinsize is set the values of these shell variables, which if not exported are not even passed to the ps command in its environment, to whatever the terminal device reports the size to be. So checkwinsize is a red herring in that if the environment variables are nonsense, the terminal device is itself reporting nonsense, and the latter is the underlying problem to be addressed.)

Which is why whilst it isn't producing the message Tilda could be at fault. The terminal device size is a shared resource that anything that has an open file descriptor to the terminal device can change arbitrarily with an ioctl() system call. But it is conventionally set, in the scenario that one is using a software terminal emulator program like Tilda, by the terminal emulator program when the size of the GUI window in which the emulation is being displayed changes. The terminal emulator program gets a GUI resize event, converts it into columns and lines, and sets the device size with ioctl().

This is not to say that something else hasn't set the size to this nonsense. After all, you can set it yourself to an arbitrary nonsense size by just running, for example, the command:

stty columns 1 rows 65535

Which brings us to …

How to reset the terminal device size

If you find yourself in the position that the terminal device is reporting a nonsense size:

  • If you are using a GUI terminal emulator, resize the GUI by a column/line or so. This should trigger the ioctl() and set the terminal size to something reasonable.
  • Set the size to something more reasonable with (for example):

    stty columns 80 rows 25
  • Use the reset command. Note that reset sets a lot of other stuff in addition to just the terminal device size.
  • If your terminal emulator is DEC VT340/VT420 compatible, emit the appropriate DECSCPP amd DECSLPP/DECSNLS control sequences directly, or use the nosh toolset's console-resize (a.k.a. resizecons) command to emit them:

    resizecons 80x25
JdeBP
  • 68,745
  • Thanks for that, @JdeBP - I will upvote this, once I have rep! – sdbbs May 21 '16 at 05:44
  • 1
    @JdeBP Please consider to delete your answer here and put it as an answer under this, that way it much more likely to get attention and appreciation than hidden under this duplicate post that did not get closed quickly enough to block people from answering. – Anthon May 21 '16 at 11:48
  • There's a Stack Exchange tool for moving answers intact, apparently. You'll have to ask someone else to wield it, though. – JdeBP May 24 '16 at 17:16