5 ms·
Yeah, I also have one that fixes the prompt to the top so you only see a small '$' at the current line, but it messes up the terminal history.
by milkbikis 14y ago
Yeah, I also have one that fixes the prompt to the top so you only see a small '$' at the current line, but it messes up the terminal history.
- pdenya 14y agoBy messes up terminal history do you mean when you push up in terminal the previous lines that show up are rendered badly or that your actual history is effected in some way?
- milkbikis 14y agoI used the ANSI control codes for moving the cursor, which seems to overwrite previous lines. Not sure if there's another way to achieve that without overwriting lines though.
- ericbb 14y agoMaybe use \033[L (ANSI for insert-line). Edit: If I understand what you're doing, then maybe you can use this: tput ind; tput home; tput il1; echo -n "header"; tput el; tput cup $LINES 0 Use "man terminfo" to lookup things like "il1" and use "infocmp" to see what they translate to in your terminal.
- ralph 14y agoI too prefer just PS1='$ ', I want the cursor to be the same distance from the margin every time, to have maximum length for typing without wrapping, and the ability to put in a few separator lines between command output by just tapping Return. However, for your problem, have you considered the terminal's title instead of the top line of the tty? printf '\033]0;foo\007'
- milkbikis 14y agoHmm, that wouldn't let me keep the colors etc. I'm on iTerm btw, perhaps you mean the title in a screen/tmux session?
- ralph 14y agoNo, I meant the window's furniture so no colours. I agree, a tty-wrapper, like tmux, would provide another option. I don't suppose there are terminals generally about where `tput hs' is true. Have you considered using the end of the prompt line for status, returning to the left for the "$ ", and being happy to do readline's redraw-current-line if you don't like the overwrite should you reach that far?
- regularfry 14y agoMine has a bunch of info, then a newline, then ' $'. Being able to see the current git branch is just too useful to drop, but I moving random distances out from the margin between commands.
- johnleppings 14y agoHow do you make your $ character appear smaller than usual?
- milkbikis 14y agoI didn't do anything- maybe it's smaller in Monaco?
- johnleppings 14y agoYou said that you used "a small '$'". How's it any smaller than usual?
- milkbikis 14y agoOh, sorry about that. I just meant that it has only a $ sign which makes it small.