4

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?

2 Answers2

2

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 Terminal.app (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...

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • 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
2

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.

(Source)