Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Minor annoyance with the Screen linux utility; when connected to a Linux (Fedora) box from my Mac (using Terminal), when I'm writing out a long command, usually when the text reaches the edge of the terminal window, the cursor drops down a line and continues the command. However, if I'm currently on the bottom row of the terminal, and run off the edge, instead of adding a new line and pushing everything up, it blanks the line and puts the cursor at the beginning of the row. If I grab the terminal window and resize its width, the command automatically pops down to a second row as the screen refreshes. Is there a way to get the command to break to a second row properly without resizing the window? Some configuration setting in Screen to get it to play nicely with Mac's Terminal?

share|improve this question
Have you tried changing your terminal type (TERM environment variable)? – voretaq7 May 23 '11 at 16:44
Within the screen program, echo $TERM is screen. Outside that is xterm-color (an SSH connection). What should they be changed to? – MidnightLightning May 23 '11 at 16:45
I have the same issue, using the 10.6 with screen on two different remote servers. – John Flatness Jul 17 '11 at 1:04

Try adding the following to your remote-side ~/.screenrc

termcapinfo xterm* ti@:te@

Do Ctrl-A :source .screenrc or restart screen after updating the file.

I made this change to disable screen's internal scrollback buffer and allow Terminal's scrollbar to work properly. As a happy side-effect, it appears to have also fixed this problem.

Note: this setting will mess with screen's ability to switch between multiple windows in the same screen session.


share|improve this answer

Hmm, screen's auto-set terminal type of screen works for me (OS X 10.5 & 10.6, connecting to a FreeBSD host). I've got no idea why it's not working for you, but you can try forcing the terminal type within screen to xterm-color and seeing if that helps.

You may also want to try different preferences for the (Advanced Settings -> Describe terminal as:") -- Again describing the terminal as xterm-color should work fine (that's what mine is set for), but if a different terminal type works and doesn't introduce any broken behavior no harm no foul...

Alternatively try reset ; stty sane within screen and see if that makes it happy -- It's possible something you ran within screen mucked about with terminal settings and left you in a screwy state...

share|improve this answer
You were definitely testing while at the bottom of the Terminal display, and not just the first command entered (near the top of the Terminal)? The line wrapping works fine in the body of the window, just at the bottom it goes wonky. – MidnightLightning May 23 '11 at 16:58
yup - filled my screen with command prompts and started typing, it correctly dropped down to the next line. – voretaq7 May 23 '11 at 17:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.