"This bash shell is now fully operational!"

Nov 29, 2006 23:20


For many years, I have been a fan of the Z shell. In particular, I loved its programmable completion and many hookable interactive events.

As the years have gone by, however, Bash has slowly re-taken the ground that ZSH originally claimed. Programmable completion, ever more elaborate prompts, and so on became as commonplace in bash configurations ( Read more... )

Leave a comment

Comments 14

jes5199 December 8 2006, 23:07:03 UTC
This is extremely cool. Thanks. (Now I have my GNU SCREEN title and my XTERM title set together using readable commands, rather than using screen's terribly conceived auto-titles)

Reply

glyf December 9 2006, 02:26:58 UTC
Glad you enjoyed it. Spread the word! I have been looking for a way to do this in bash for years, and others looking for a similar hack will likely have a hard time finding it from google... (how did you run across it, anyway?)

Reply

jes5199 December 9 2006, 02:31:32 UTC
I googled for preexec() bash
because I had seen the zsh preexec example in the Screen infodocs, and I didn't see any good reason why that hadn't been ported to bash. I was about to install the patch when I found your post.

Reply

rawy March 18 2007, 17:12:14 UTC
Cool news cool ideas! and cool you also

Reply


Awesome georgiajosh June 21 2007, 16:22:07 UTC
Thanks this is an awesome find, I never would have found this out on my own, Congrats on the discovery.
Thanks for the post.

Josh King Atlanta Center for Cosmetic Dentistry

Reply

Re: Awesome glyf June 21 2007, 19:39:51 UTC
Hi there,

I am going to go out on a limb here and assume your post is legit, but I almost deleted it as spam; you tripped almost every one of my triggers. Just some pointers for next time, your post looks like spam because:

  • it's short
  • it doesn't mention the content of the article specifically
  • it includes a hyperlink to a completely unrelated commercial site

Reply


Question about preexec.bash lmjog July 11 2007, 15:09:32 UTC
Thanks for a great hack to bash!

I've tried to use the precmd & preexec functions used at the bottom of your script, but it seems that I need to setup the variables $SCREEN_RUN_HOST and $SCREEN_HOST somewhere in my .bashrc to get it work correctly.

Could you please share what how you set up those?

TIA
/LM

Reply

Re: Question about preexec.bash glyf July 11 2007, 15:39:35 UTC
Oh. That's unfortunate. Those variables are part of some pretty gratuitous hacks in my overall setup; I'll try to correct this "module" so that it doesn't require them.

Reply

Re: Question about preexec.bash lmjog July 11 2007, 16:08:16 UTC
If possible if you could just share the info on how you set them. I use a setup with a couple of nested screens myself, and if I can read your script correctly, I like the idea how it presents itself.

Reply

Re: Question about preexec.bash glyf August 2 2007, 19:29:45 UTC
Sorry for the long delay; I keep thinking I'll have time to eventually clean everything up and do a real release of my whole config.

In the meanwhile, just do this in your shell startup somewhere:
export SCREEN_HOST=`hostname -s`then in your screenrc,

setenv SCREEN_RUN_HOST $SCREEN_HOST
setenv SCREEN_RUN_USER $USER

# Many sshd configurations accept "LC_*" environment variables. Take advantage
# of that to sneak our environment variables over there.
setenv LC_SCREEN_RUN_HOST $SCREEN_HOST
setenv LC_SCREEN_RUN_USER $USER

Reply


very very cool! corporal_touchy November 19 2007, 17:14:46 UTC
no not cool
plain f**king awesome!

this should totally be incorporated into bash by a patch instead of hack

but meanwhile
thanks for the hack! ;)

cool trick with the LC_ vars to shorten the prompts, too!

Reply


Leave a comment

Up