0

I've seen demos where folks have had a Mac OSX terminal where the current time + username + directory are afixed (like 'freeze rows' in excel) to the top of the terminal window (not in the title bar), offering all the friendly context info I need while leaving lots of room for the command prompt after a simple '$'.

How do I tweak my Terminal to look like that?

PS. If it matters, I have recently started using an alternative shell called fish: http://fishshell.com/ but I'm happy with any answer for any shell.

EDIT: I went off to find the demo which first placed this idea in my head and I actually FOUND IT: https://www.youtube.com/watch?v=zBt2g9ekiug#t=55

2
  • What does that youtube link have to do with your question? Commented Apr 17, 2014 at 20:47
  • It takes you to the exact spot in the video where the presenter is using Mac OSX terminal with some information pinned to the top. This is exactly what I want. Commented Apr 24, 2014 at 13:13

1 Answer 1

0

Edit 2:

Add these lines to your ~/.zshrc:

case $TERM in
  xterm*)
    precmd () {print -Pn "e]0;%~a"}
    ;;
esac

This is the result:

enter image description here

If you are using bash:

case $TERM in
  xterm*)
    PS1="[e]0;wa]\$ "
    PROMPT_COMMAND='echo -ne "${USER}@${HOSTNAME}:${PWD/#$HOME/~}"'
    ;;
esac

Have a look at this link. I think you'll enjoy it :)

Edit: another good link

2
  • Thanks for the advise. I'll review it and filter the content in a couple of hours Commented Apr 15, 2014 at 10:34
  • Thanks for the links @oski but its not quite what I'm looking for. In fact, the first link is almost exactly what I'm using right now, only with fish shell this is one of the prebuilt prompt options available from the web-based fish_config. I just now went out and found the demo that I was thinking of and will add it to the question text to make it more clear. Commented Apr 15, 2014 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .