Forum

scrollback buffer e...
 
Notifications
Clear all

scrollback buffer erased on clear command

0 Posts
2 Users
0 Reactions
290 Views
 Tony
(@tcocke)
Active Member
Joined: 19 years ago
Posts: 5
Topic starter  

I have found that when a "clear" command is issued at the unix/linux command prompt, the porion of the history buffer currently displayed onscreen is erased from the history buffer as well. Is there a way to prevent the current screen from being erased from history upon issue of a unix 'clear' command?


   
ReplyQuote
 Tony
(@tcocke)
Active Member
Joined: 19 years ago
Posts: 5
Topic starter  

I have slso noticed the same symptom in linux when a vi is performed. The screen is cleared which is normal, but the current screen on display prior to the vi being issued is subsequently missing from the scrollback history.


   
ReplyQuote
(@bpence)
Member Admin
Joined: 1 year ago
Posts: 1375
 

Tony,

The scrollback is simply a history of stuff that has scrolled off the screen. When the screen is cleared, it doesn't scroll at all, the data simply disappears.

It would be a mistake to blindly force a 'clear' to scroll all of the data off. For instance, many apps issue clears throughout the run of the app, which would thorougly trash the scrollback if each one forced data up into the scrollback.

If you want, you can apply some unix trickery to do what you want. For example, create an alias or a wrapper around the 'vi' command to issue the proper number of carriage returns before running vi. This will cause the screen to scroll, preserving the current page in the scrollback history prior to vi clearing the screen.


   
ReplyQuote
 Tony
(@tcocke)
Active Member
Joined: 19 years ago
Posts: 5
Topic starter  

Brian,
Thanks for the response. I guess I can see your point that in certain apps you would not want to keep the display on a clear, but for someone working from a linux shell, simply doing command line grunt work like pg and ls and vi, it is very useful to be able to see ALL info that has been displayed, especially the most current lines prior to a vi command. We are about to switch to Absolute in our shop from Procomm (which does not erase the current screen from history on a clear BTW) and this feature would be invaluable to our programmers.

Thanks,
Tony


   
ReplyQuote
(@bpence)
Member Admin
Joined: 1 year ago
Posts: 1375
 

Tony,

I think the proper way to do this is to make vi (and others) use the alternate screen buffer. Then, when they exit, the contents of the current screen are restored. In other words, I believe that changing the behavior of the clear screen has implications in to many places and risks polluting the scrollback, but there are believe that there are still ways to do what you want to do.

This alternate screen buffer seems to be the default behavior on Linux if you're using xterm as your terminal type, but there may be other factors involved.

What host OS are you using?

Which shell?

Brian


   
ReplyQuote
Share: