• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how can I reliably query the correct terminal window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how can I reliably query the correct terminal window?


  • Subject: Re: how can I reliably query the correct terminal window?
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 3 Dec 2008 17:12:39 -0500

On Wed, Dec 3, 2008 at 5:06 PM, Skeeve <email@hidden> wrote:
> Doug McNutt schrieb:
>>
>> Most interesting. I do ssh's all over the place and I'd like to know how
>> to execute any command "over there" that can change the window name.
>
> Easy. Put this into your .profile
> PS1="\033]0;title text here\007...rest of your prompt"
> export PS1

The only problem with that is that it confuses bash's command-line
editing, which thinks that all that stuff in your prompt takes up
screen space and therefore gives you less than the whole line to work
with.  Better, IMO, to use PROMPT_COMMAND - but then you don't have
the PS1 escapes like '\h', so it takes a little more work to get that
info. This is what I use to keep track of current hostname and working
directory:

PROMPT_COMMAND='echo -ne "\e]0;$(hostname):${PWD/$HOME/~}\a" '

> You can even use echo, provided it can handle the \033 \007:

If you use bash, pass the -e option to echo to have it honor escape
sequences, and you can use \e for "escape" (ESC = decimal 27 = octal
33) and \a for "alert" (BEL = 7).

--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >how can I reliably query the correct terminal window? (From: Skeeve <email@hidden>)
 >Re: how can I reliably query the correct terminal window? (From: "Mark J. Reed" <email@hidden>)
 >Re: how can I reliably query the correct terminal window? (From: Skeeve <email@hidden>)
 >Re: how can I reliably query the correct terminal window? (From: Skeeve <email@hidden>)

  • Prev by Date: Re: how can I reliably query the correct terminal window?
  • Next by Date: Renaming multiple files
  • Previous by thread: Re: how can I reliably query the correct terminal window?
  • Next by thread: Re: how can I reliably query the correct terminal window?
  • Index(es):
    • Date
    • Thread