News for hackers. Stuff that matters.
Re:A Powerline-style prompt for Bash by milkbikis on Sunday September 09, 2012 @04:01AM (#4495282)
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.
Re:A Powerline-style prompt for Bash by ralph on Sunday September 09, 2012 @04:53AM (#4495342)
I 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'

Re:A Powerline-style prompt for Bash by regularfry on Sunday September 09, 2012 @05:00AM (#4495357)
Mine 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.
Re:A Powerline-style prompt for Bash by milkbikis on Sunday September 09, 2012 @04:58AM (#4495351)
Hmm, that wouldn't let me keep the colors etc. I'm on iTerm btw, perhaps you mean the title in a screen/tmux session?
Re:A Powerline-style prompt for Bash by ralph on Sunday September 09, 2012 @11:48AM (#4496044)
No, 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?
Re:A Powerline-style prompt for Bash by pdenya on Sunday September 09, 2012 @04:43AM (#4495332)
By 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?
Re:A Powerline-style prompt for Bash by milkbikis on Sunday September 09, 2012 @04:48AM (#4495338)
I 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.
Re:A Powerline-style prompt for Bash by ericbb on Sunday September 09, 2012 @08:31AM (#4495632)
Maybe 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.
Re:A Powerline-style prompt for Bash by johnleppings on Sunday September 09, 2012 @08:16AM (#4495609)
How do you make your $ character appear smaller than usual?
Re:A Powerline-style prompt for Bash by milkbikis on Sunday September 09, 2012 @12:49PM (#4496216)
I didn't do anything- maybe it's smaller in Monaco?
Re:A Powerline-style prompt for Bash by johnleppings on Sunday September 09, 2012 @12:54PM (#4496231)
You said that you used "a small '$'". How's it any smaller than usual?
Re:A Powerline-style prompt for Bash by milkbikis on Sunday September 09, 2012 @01:17PM (#4496293)
Oh, sorry about that. I just meant that it has only a $ sign which makes it small.