1

I'm trying to use the Linux program Screen to code on my Ubuntu laptop but its behaving really strangely. When i open a file, the file looks like it should but as I move down to the bottom, brackets appear in strange places. These brackets seem to match the bracket placement of the line before it.

Here's a screenshot of my cursor at the top: Cursor at top

Here's a screenshot once its reached the bottom: Cursor at bottom

Notice all the extra brackets everywhere? There also seems to be two separate line counters in the bottom right hand corner.

Another weird thing is that my cursor is limited in its movements. ON line 3 my cursor can only go as far as the 1st closed bracket, as if it was on the line above it.

Anyone have any idea whats going on here?

EDITS:

I tried to use tmux but I got the same issue.

Should also mention I don't have a .screenrc file.

12
  • what are you opening the file with? Jan 5, 2016 at 18:16
  • VIM. Opening a file outside of screen with VIM works without any issues. Its only acts weird when I'm within a screen it seems.
    – adelprete
    Jan 5, 2016 at 18:19
  • You're moving the cursor with j/k, right? Jan 5, 2016 at 18:27
  • yes, but it does the same thing whether I use j/k or the arrow keys.
    – adelprete
    Jan 5, 2016 at 18:30
  • do you have pkg ncurses-term? Jan 5, 2016 at 19:23

2 Answers 2

0

I've seen a similar issue on Cygwin, and one work-around is to resize your terminal window after starting screen.

I don't know why this happens, but screen misreads the number of lines in the terminal on startup. If you re-size your terminal after that, the issue is corrected for that session.

In your screenshots the terminal is maximized. Quit out of Vim and type the following:

tput lines

This will tell you the number of lines screen thinks you have...

Now reduce the terminal size and re-maximize it, then re-run the command:

tput lines

Are you getting the same answer?

1
  • I am. If doing it correct, in screen and maximized I got 41 lines, reduced terminal size, then re-maximized it and got 41 again.
    – adelprete
    Jan 7, 2016 at 18:08
-1

1. It looks like you're using gnome-terminal. Try using xterm and see if the problem goes away. I'm not saying switch to xterm (okay, I am), but just see if that's where the problem is. If you're already using xterm, try gnome-terminal, or rxvt, or whatever.

2. Try reset ; vim your-file.html

  1. Try cp /usr/share/doc/screen/examples/screenrc ~/.screenrc and restarting screen.
2
  • Issue happens in both xterm and gnome -terminal unfortunately.
    – adelprete
    Jan 5, 2016 at 19:06
  • Tried your 3rd step. Still no dice.
    – adelprete
    Jan 5, 2016 at 20:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .