Solved The characters of the exited terminal program are still displayed on the screen.

When I connecting to the system remotely using SSH, the characters of the exited terminal program are still displayed on the screen.
For example, when I visit system by using SSH, after I exit "htop" or "nano", characters of htop/nano are still on the screen. On OpenBSD or Linux, when you exit a terminal program, characters of the that program will disappear, the command prompt appears on the next line, I think that's good for me.

Can FreeBSD be configured as I like???
Thanks all of you.
 
Same on man pages. On linux the manpage dissapears after you quit the viewer.

I guess the text stay on screen on FreeBSD is an intended behavier. And I prefer the text stay on screen!

How often I man something in Linux, exit the manpage, start typing the comand I man-ed before and... what was the parameter I intended to use? Was ist --stay-silent or was it --stay-quiet or --keep-silent? Grrr. Re-open the manpage. Seek for the parameter again. On FreeBSD the most important part of manpage would be still on screen. This is not really beautyful, but very handy!
 
  • Thanks
Reactions: byl
Set a shell alias that does this. Example:

$ alias ctop='top ; clear'
$ ctop

However, I agree with Ordoban - I prefer the text stay.
 
  • Thanks
Reactions: byl
... after I exit "htop" or "nano", characters of htop/nano are still on the screen. On OpenBSD or Linux, when you exit a terminal program, characters of the that program will disappear, the command prompt appears on the next line, ...
You need to change the terminal type to obtaine that effect. Have a look at the /usr/share/misc/termcap data base, search for xterm, you will find there besides other xterm terminals xterm-r6-clear and xterm-r5-clear. Those have the capability to ""clear the screen" after vi, more/less, etc." There are other xterm terminals claiming the same, but those two are the only ones I had success with.

You can set individually the users TERM environment variable, or change the terminal type in /etc/ttys to one of the above mentioned. Setting as environment variable has immediate effect (when set in the shells config file after a log out, log in). When is set in /etc/ttys a reboot or shutdown now followed by exit is necessary, also make sure no other TERM variable in the users shell configuration is set, otherwise it will supersede the setting in /etc/ttys.
 
  • Thanks
Reactions: byl
You need to change the terminal type to obtaine that effect. Have a look at the /usr/share/misc/termcap data base, search for xterm, you will find there besides other xterm terminals xterm-r6-clear and xterm-r5-clear. Those have the capability to ""clear the screen" after vi, more/less, etc." There are other xterm terminals claiming the same, but those two are the only ones I had success with.

You can set individually the users TERM environment variable, or change the terminal type in /etc/ttys to one of the above mentioned. Setting as environment variable has immediate effect (when set in the shells config file after a log out, log in). When is set in /etc/ttys a reboot or shutdown now followed by exit is necessary, also make sure no other TERM variable in the users shell configuration is set, otherwise it will supersede the setting in /etc/ttys.
by change TERM=xterm-clear, I simply solved this problem. buddy!
 
Same on man pages. On linux the manpage dissapears after you quit the viewer.

I guess the text stay on screen on FreeBSD is an intended behavier. And I prefer the text stay on screen!

How often I man something in Linux, exit the manpage, start typing the comand I man-ed before and... what was the parameter I intended to use? Was ist --stay-silent or was it --stay-quiet or --keep-silent? Grrr. Re-open the manpage. Seek for the parameter again. On FreeBSD the most important part of manpage would be still on screen. This is not really beautyful, but very handy!
You are right, text keep on the screen can show some thing we need.
 
Interesting. I set TERM xterm-clear in csh(1) and bash(1) and type in /etc/ttys, but it had no effect. Where did you set the variable?
when I am in bash(because I use bash by default), I put
"TERM=xterm-clear; export TERM"
to "/home/myname/.profile" and just run "source .profile"
and then, I found both bash/csh/sh/tcsh are in "clear mode", text no longer stay, that's very nice.
 
As far as man is concerned, a lot of this has to do with the behavior of the "less" command. When man outputs a man page, it automatically pipes the output through a pager program, I think by default it uses "more". On FreeBSD, the version of more that ships these days is "less", and has a lot of features and is complex. I think less can be configured to switch the terminal to an alternate screen buffer, then display the output, and at the end switch back. I think emacs does the same thing, don't know about other editors. Like that, if you run "man" or "emacs", after you're done, your old screen content is (mostly) still there (mostly because the command line used to start man or emacs is still visible). Some people seem to think that this is a good feature.

You can use a variety of switches to configure more and less to handle this in different fashions. For example, I have mine configured with "LESS_IS_MORE=1" and "MORE=-Er", but your taste may vary. And I leave the terminal type and termcap alone.

Personally, I don't like it at all for man, because after man is done, I want the output on to stay on the screen; if I need older stuff, I can just scroll back. On the other hand, I like it for emacs, because then I can toggle back and forth between editing source, and seeing the most recent output, without having to scroll. To each his own, this is a question of taste and favorite workflow.
 
  • Thanks
Reactions: byl
As far as man is concerned, a lot of this has to do with the behavior of the "less" command. When man outputs a man page, it automatically pipes the output through a pager program, I think by default it uses "more". On FreeBSD, the version of more that ships these days is "less", and has a lot of features and is complex. I think less can be configured to switch the terminal to an alternate screen buffer, then display the output, and at the end switch back. I think emacs does the same thing, don't know about other editors. Like that, if you run "man" or "emacs", after you're done, your old screen content is (mostly) still there (mostly because the command line used to start man or emacs is still visible). Some people seem to think that this is a good feature.

You can use a variety of switches to configure more and less to handle this in different fashions. For example, I have mine configured with "LESS_IS_MORE=1" and "MORE=-Er", but your taste may vary. And I leave the terminal type and termcap alone.

Personally, I don't like it at all for man, because after man is done, I want the output on to stay on the screen; if I need older stuff, I can just scroll back. On the other hand, I like it for emacs, because then I can toggle back and forth between editing source, and seeing the most recent output, without having to scroll. To each his own, this is a question of taste and favorite workflow.
Thank you!
 
Back
Top