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... )
Comments 14
Reply
Reply
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
Reply
Thanks for the post.
Josh King Atlanta Center for Cosmetic Dentistry
Reply
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:
Reply
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
Reply
Reply
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
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