Terminal emulator not wrapping correctly (overlapping)

I have ubuntu 9.10 with gnome terminal. When i login to my linode, i notice my console line overlaps when it gets too long instead of going to the next line or just not wrapping(with a scroll bar). I also noticed that even if i maximize my terminal, my console stays fixed. The console works fine locally.

3 Replies

@ironic_username:

I have ubuntu 9.10 with gnome terminal. When i login to my linode, i notice my console line overlaps when it gets too long instead of going to the next line or just not wrapping(with a scroll bar). I also noticed that even if i maximize my terminal, my console stays fixed. The console works fine locally.
Can you be a little more precise about what you mean by "console"? So you mean your true Linode console (accessed via LISH) or just any normal remote shell on your Linode running within a local terminal window? From the problems, my first guess is that you're using LISH and would be much happier with an ssh session directly to your Linode instead (reserving the use of LISH for emergency console access).

When you are working locally, the console window is several components working in concert - the terminal emulator (gnome-terminal) that owns the Window and handles display, and the underlying shell with which you interact. There's also a "pseudo-terminal" device in between. When working remotely, you may have these same components locally, but with an additional command running in the shell (like ssh) to connect to a remote shell (with its own pseudo-terminal device). Alternatively you might run a remote gnome-terminal in which case those components are on the remote system and all you have locally is the display of the window.

When resizing the window, that resize has to get communicated through all of these components so that any commands executed (as well as the shell itself) have accurate dimension information. If you are using a local gnome-terminal, then resizing has to get communicated to your local shell (e.g., bash), as well as through any remote connection (like ssh) to the target system. Whether or not that all happens properly depends on the specific connection type. With ssh, the client on your local host typically transmits the change through to the server, but depending on how the server is connected to the remote shell, it may or may not make it to the shell.

And in a case specific to Linode, an ssh to LISH is not going to communicate remote window size changes, because beneath the covers LISH is like a raw serial console on your Linode. Take a peek at the thread at http://www.linode.com/forums/viewtopic.php?t=4308 . You can however, manually adjust the remote tty width to match your local gnome-terminal window if you know the size you want.

As for overlapping long lines, that often implies some sort of terminal setting mismatch, between your remote tty or shell and the terminal emulator (e.g., gnome-terminal). If you are using bash remotely, for example, and it does not know the window size has changed, it will continue to wrap at the old width, and exhibit the behavior you are seeing. This should correct itself if you manually adjust your remote system window size with stty (as in the referenced thread). One note is that bash does need the chkwinsize shell option (check with "shopt") on to check for changes after each command. I believe Ubuntu has that on by default in their stock setup, but it may be distribution specific. So if that setting is off, you can see this behavior with bash even over a normal ssh connection.

So if you're using LISH, I suspect that you can correct this by using stty to set the proper terminal size. But in that case I'd switch to an non-LISH ssh connection anyway, reserving LISH for emergencies. If it's happening over a non-LISH ssh connection, and you're using bash (I think some other shells are similar) check for a setting like bash's chkwinsize to ensure the shell knows the terminal size has changed.

– David

Wow thanks David! It didn't even occur to me that I wasn't login in directly to my server (1st thing I did when i got my acc, was copy/paste the lish add, pasted it into my terminal, and I have used it ever since)

I really screwed up my terminologies, but if I understand what you are saying, I have been basically remoting into LISH, then remoting into my server from 'inside' LISH

I just SSHed directly to my server using my IP and everything works dandy (it even looks better). Thanks.

@ironic_username:

I really screwed up my terminologies, but if I understand what you are saying, I have been basically remoting into LISH, then remoting into my server from 'inside' LISH
Pretty much, although I probably wouldn't call the LISH<->Linode connection "remote", though it's definitely an extra communication step.

It's more akin to how older consoles (or even current ones in large scale server environments) worked on systems when they were locally connected with a serial cable. Internally it's implemented by a special Xen serial console driver which appears to your Linode as a serial interface, typically tty1. So LISH acts as a bridge between your ssh network connection and the "serial" console on your Linode, along with offering some local commands for status and control, via the "screen"-like (Ctrl-A d) escape mechanism.

> I just SSHed directly to my server using my IP and everything works dandy (it even looks better). Thanks.
Great - glad to hear it.

– David

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct