|
|
A year later...
Another recent titlebar hint reminded me of this one just in time for its first anniversary :-) I'm unconvinced by the current "Addendum to original story", because as pointed out above, the proposed "ultimate title bar" still causes the same sort of bugs we've seen. In fact, to recap, postcmd has two (apparently well known) problems with shell expansions:
With this, one problem remains: same-name aliases never make it into the title bar (but at least now their output isn't chopped). This seems due to the way tcsh avoids a recursive expansion loop -- see item 20 from the bottom of this file. So far as I can see, the only way out of that is to always use backslash escapes when defining such aliases, thus:sched +0:00 alias postcmd 'printf "\\033]0; %s \\007" "\\!#:q"'
P.S.: In all of the above, read any number of consecutive backslashes as just one backslash. (I tried to put enough of them that at least some would survive the geeklog treatment...)
A year later...
Oof! I spent too much time looking at this and all related hints I could find, and here is the synthesis I came up with- thanks to all the many people whose code appears in chunks here, you've given me a great education in all of this.
In my aliases.mine:
alias precmd 'printf "\033]0; %s \007" "`date "+%H:%M"`" ${cwd}"| sed -e "s%$HOME%~%"'
- prints time, cwd, current job
also, more futzing on other hints elsewhere gave me this oh so fun prompt:
now I'm wondering if I set up some sort of precmd collision here.. oh well, it all works, at least for now.. ---
A year later...
Oof! I spent too much time looking at this and all related hints I could find, and here is the synthesis I came up with- thanks to all the many people whose code appears in chunks here, you've given me a great education in all of this.
In all code below, 2 backslashes actually means one backslash.
In my aliases.mine:
alias precmd 'printf "\033]0; %s \007" "`date "+%H:%M"`" ${cwd}"| sed -e "s%$HOME%~%"'
- prints time, cwd, current job
also, more futzing on other hints elsewhere gave me this oh so fun prompt:
now I'm wondering if I set up some sort of precmd collision here.. oh well, it all works, at least for now.. --- |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|