Re: pwd in the terminal title

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-01-04 at 08:03 +0300, regatta wrote:
> Hi
> 
> Anyone know how can I make the terminal display the working directory
> in the title ?

I have this in my .bashrc - it works for all xterm-like apps that
support the extension.

# If this is an xterm set the title to "user@host: dir"
case $TERM in
  xterm*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
      ;;
  *)
      ;;
esac

The escape sequence used can unfortunately crash some terminal emulators
that weren't coded properly to handle "erroneous" escape sequences
(personally, I'd consider that a fairly serious security hole in the
terminal emulator, since it probably means that any app that can display
text to the terminal window can crash it and/or take it over, which
could for example allow certain remote apps to take over your machine).

_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list

[Index of Archives]     [Fedora Desktop]     [Trinity Users]     [KDE]     [Gimp]     [Yosemite News]

  Powered by Linux