|
|
|
Use Growl to monitor long-running shell commands
Amazing work here, especially the bash code for doing this. Even with how customized I've got bash to be, zsh seems to incorporate many of the great features that don't require scripts like this to be created.
A few thoughts: 1) Would it be possible to retain another PROMPT_COMMAND function? I have (had) a very nice newCMD to truncate the PWD on PS1 (the shell prompt), which required using the PROMPT_COMMAND variable? 2) Quickly, I did modify the ten second limit to much longer but have found that the growl popups from any command are annoying. I think putting in a white/black list scheme would help here since commands like make are optimal for something like this, while closing a tab after being connected for an hour via SSH is not.
Use Growl to monitor long-running shell commands
1) Not unless you improve preexec.bash to allow this. It explicitly states:
"Note: this module requires 2 bash features which you must not otherwise be using: the "DEBUG" trap, and the "PROMPT_COMMAND" variable. preexec_install will override these and if you override one or the other this _will_ break". 2) Depending on your shell usage pattern, yes, there will be false positives (notifications you don't need or want). I thought about a white/blacklist approach, but it's too much hassle for my taste. I like to keep stuff like that simple, and I don't mind the false positives. They do distract me for a second, but I still prefer that to having to decide in advance whether or not I'll be notified. Making that decision in advance each time I execute a shell command would take me more time than looking at a superfluous notification once in a while. And while this setup works fine for me, I consider that a technique rather than a product, so go ahead and tweak it to your tastes.
Use Growl to monitor long-running shell commands
as for #1, i use a different technique which may be of use to you in this scenario. specifically, the steps below do not use PROMPT_COMMAND.
1. take the contents of your newPWD command and put them in an executable shell script somewhere in your path. 2. change PS1 to use something along the lines of "\$(<shell name here>)". for example, my PS1 is "\\h:\$(trim-pwd.bash)\$ \[\e]0;\H:\w\a\]" (as an aside, the escape sequence is there to change the title of terminal to the working directory) and that's it. you now should have the path trimmed without using the PROMPT_COMMAND environment variable. i can post the contents of "trim-pwd.bash" if anyone needs it. hth |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,522 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.19 seconds |
|