Gibble
Posts: 56
Joined: Wed May 09, 2012 9:52 am

terminal screen not scrolling correct after running app...

Mon Dec 24, 2012 4:44 pm

Hi all,

I'm messing about with some Python stuff (pi3d), and ssh'ing (no idea if this makes any difference, maybe be the same from a direct terminal).

After I've run my code, and returned to my normal terminal session, output doesn't appear scrolled correct on the screen..carriage returns seem to move across the screen rather than to the next line, and output seems buffered or something. Quite hard to explain. If I do an 'ls'<cr>, I never see the 'ls' appear, but I do see the files listed. So I can't see what I'm typing in the terminal. Hope that makes sense sort of.

Its always fine at first, and I've just started using stuff like keyboard detecting in game, so I'm wondering if its related. Is there a way in a program to have it always reset the terminal somehow ? Not sure if that makes sense, as not sure what the problem is!

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: terminal screen not scrolling correct after running app.

Tue Dec 25, 2012 7:06 am

I know what you mean but don't know why it happens.
All I do is open a new tab in the terminal window (shift-ctrl-t if I remember rightly) and close the one that's playing up.

Not a great fix but hope it helps.
Dave.
Apple say... Monkey do !!

Gibble
Posts: 56
Joined: Wed May 09, 2012 9:52 am

Re: terminal screen not scrolling correct after running app.

Tue Dec 25, 2012 7:43 pm

Just in case anyone else gets this, typing 'reset' into the bash prompt will reset everything correct!

efflandt
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA

Re: terminal screen not scrolling correct after running app.

Thu Dec 27, 2012 12:48 am

If your script does something like formatted or colored output using ansi escape sequences or screen codes, or in some cases something that the terminal thinks are ansi codes, like if you cat a binary file or look at one with less , that can leave your screen in an unusual state, possibly with strange or invisible fonts (same color as background). But I am old school, so if that happens I just (blindly if necessary) type stty sane and hit enter. I had forgotten about reset.

From reading man reset, if something alters what the Enter key does, try ^Jreset^J (^J = Ctrl+J which is same as newline or what Enter key normally does in Linux).

Return to “Python”