You are not logged in.
When closing a CLI program the command prompt always appears in the middle of the screen.
How do I avoid that ??
I have a alias cls='clear' in my .bashrc, but how do I make it so the screen clears every time when closing a program ??
/Niels
Registered Linux user #133791
Get counted at http://counter.li.org
Offline
Hi,
I thought a bit about it, normally you would use bash's PROMPT_COMMAND, but clearing the prompt after every command would be a bit counter productive. You could use the following small function in your .bashrc though:
clearprompt() {
eval $1
clear
}
And then just set an alias in your .bashrc for the cli app you want the prompt to clear after its executed, for example:
alias top="clearprompt /usr/bin/top"
you have to use the full path to the command in the alias when you want to give the alias the same name as the command itself otherwise bash segfaults. It's probably a dirty hack I know .
HTH
Last edited by chimeric (2008-02-29 10:53:56)
Offline
Argh come on' !!
There must a more proper way to do this
/Niels
Registered Linux user #133791
Get counted at http://counter.li.org
Offline
What terminal are you using? Also can you give an example of a program that causes this?
I mean does it happen when you view a man page and then exit?
I'm using urxvt and exiting from vim, rtorrent, a man page etc., I don't have this problem.
Offline
I'm using urxvt, but since I can't reproduce this i think it is related to xmonad (my wm)
/Niels
Registered Linux user #133791
Get counted at http://counter.li.org
Offline
I think you should find a proper fix instead of clearing the screen when each command exits. How will you ever read the output from ls or find without piping it through less or redirecting it to a file?
Have you changed your prompt? Sometimes that can cause weird behaviour
Last edited by dmartins (2008-03-01 15:34:12)
Offline