FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 11-16-2011, 12:51 PM
Bastien Dejean
 
Default Dynamic Titles in urxvt (bash) Without Side Effects?

Hey,

I've added the following lines to my .bashrc:

case "$TERM" in
rxvt*|xterm*)
set -o functrace
trap '[ -z "$BASH_SOURCE" ] && printf "%b" "e]0;$BASH_COMMANDa"' DEBUG >& /dev/null
;;
esac

(It sets the current title of the current window according to the last
ran command.)

But alas, it generates side effects, if I issue this:

ls "$(ls -1 | head -1)"

I get:

ls: cannot access foo.bar: No such file or directory

Strange or trivial?

Cheers,
--
Bastien
 
Old 11-17-2011, 04:32 PM
Bastien Dejean
 
Default Dynamic Titles in urxvt (bash) Without Side Effects?

Mantas Mikulėnas a écrit :

> You can sort of avoid this by redirecting the output to the proper
> location -- your terminal. (I'm not sure how reliable this is.)
>
> trap '[[ $BASH_SOURCE ]] ||
> printf "e]0;%sa" "$BASH_COMMAND" >/dev/tty' DEBUG

Thanks, it annihilated the side effects.

--
Bastien
 

Thread Tools




All times are GMT. The time now is 10:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org