Re: name sessions in konsole

2004-04-25 Thread Wolfgang Mader
Wow - that is just more as I have asked for.
Thank you very much.
Cheers Wolfgang

On Sunday 25 April 2004 19:03, Robert Lindgren wrote:
> sure is possible:
>
> add something like:
> PS1="\[\033]0;[EMAIL PROTECTED]: \w\007\]\[\033]30;[EMAIL PROTECTED]: [EMAIL 
> PROTECTED]:\w] "
> to your .bashrc
>
> or .tcshrc:
> alias precmd 'echo -n "\033]0;${HOST}:$cwd\007\033]30;${HOST}:$cwd\007"'
>
> Note that this should be added on the remote end, and local if you want it
> there too :)
>
> Regards
> Robert
>
> On Sunday 25 April 2004 11:58, Wolfgang Mader wrote:
> > Hello,
> >
> > If you open a new tab for a new session in konsole normaly there appears
> > something like "shel"l (or whatever type of session you have chosen) on
> > the tab. I am working on different machines and it would be nice to have
> > the name of the machine where the shell was opened (or much better -
> > where the shell ends actually). Is this possible with konsole? Perhaps
> > with output from uname -n?
> > Thank you
> > Wolfgang




Re: name sessions in konsole

2004-04-25 Thread Adeodato Simó
* Nick Leverton [Sun, 25 Apr 2004 20:28:31 +0100]:
> On Sun, Apr 25, 2004 at 07:34:58PM +0200, Robert Lindgren wrote:
> > > This only changes it in the session title though, 

> > No it doesn't, it changes both the tabname and the session name. the first 
> > escape sequence changes the session name, the second the konsole tab.

> It doesn't here, but it's clearly doing something to the tab (blanking
> it mostly), so it's probably my setup.  I'm sorry, and I'm grateful to
> you for the information - something else to fix !

What happens if you do:

$ echo -e '\033]30;NAME\007'

-- 
Adeodato Simó (a.k.a. thibaut)
EM: asp16 [ykwim] alu.ua.es | IM: my_dato [jabber.org] | PK: DA6AE621
 
A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?


signature.asc
Description: Digital signature


Re: name sessions in konsole

2004-04-25 Thread Nick Leverton
On Sun, Apr 25, 2004 at 07:34:58PM +0200, Robert Lindgren wrote:
> > This only changes it in the session title though, 
> 
> No it doesn't, it changes both the tabname and the session name. the first 
> escape sequence changes the session name, the second the konsole tab.

It doesn't here, but it's clearly doing something to the tab (blanking
it mostly), so it's probably my setup.  I'm sorry, and I'm grateful to
you for the information - something else to fix !

Nick




Re: name sessions in konsole

2004-04-25 Thread Jarno Elonen
> Possibly it could be done via DCOP, if you wrapped your local /usr/bin/ssh
> in a script to do that, but I don't know sufficient about DCOP to say
> if it's so.

I'm not sure if this is what you are after here, but (~/bin/ssh):

#!/bin/bash

REAL_SSH=/usr/bin/ssh

if [ ! -z "$KONSOLE_DCOP_SESSION" ]
then

  # Use the last argument as the title
  for arg in $@; do
NEW_TITLE="$arg"
  done

  OLD_TITLE=`dcop "$KONSOLE_DCOP_SESSION" sessionName`
  dcop "$KONSOLE_DCOP_SESSION" renameSession "$NEW_TITLE"

  function restore_title() {
dcop "$KONSOLE_DCOP_SESSION" renameSession "$OLD_TITLE"
  }

  # If SSH is interrupted (CTRL-C), restore the old title
  trap "restore_title" SIGINT
  $REAL_SSH $*
  restore_title

else
  $REAL_SSH $*
fi


- Jarno




Re: name sessions in konsole

2004-04-25 Thread Robert Lindgren
On Sunday 25 April 2004 19:29, Nick Leverton wrote:
> On Sun, Apr 25, 2004 at 07:03:10PM +0200, Robert Lindgren wrote:
> > sure is possible:
> >
> > add something like:
> > PS1="\[\033]0;[EMAIL PROTECTED]: \w\007\]\[\033]30;[EMAIL PROTECTED]: 
> > [EMAIL PROTECTED]:\w] "
> > to your .bashrc
>
> This only changes it in the session title though, which AFAIK only shows
> up for the current tab.  It's not even shown for the "switch to tab"
> tab context menu in 3.2.
>

No it doesn't, it changes both the tabname and the session name. the first 
escape sequence changes the session name, the second the konsole tab.

Cheers
Robert 




Re: name sessions in konsole

2004-04-25 Thread Nick Leverton
On Sun, Apr 25, 2004 at 07:03:10PM +0200, Robert Lindgren wrote:
> sure is possible:
> 
> add something like:
> PS1="\[\033]0;[EMAIL PROTECTED]: \w\007\]\[\033]30;[EMAIL PROTECTED]: [EMAIL 
> PROTECTED]:\w] "
> to your .bashrc

This only changes it in the session title though, which AFAIK only shows
up for the current tab.  It's not even shown for the "switch to tab"
tab context menu in 3.2.

The only way I know of to get it into the tab, but statically even
so, is to open that tab from your konsole bookmarks.  You can put
"ssh://[EMAIL PROTECTED]" as the URL, and the title comes from the bookmark.
I keep track daily of about a dozen tabs on several konsoles, that way.

Possibly it could be done via DCOP, if you wrapped your local /usr/bin/ssh
in a script to do that, but I don't know sufficient about DCOP to say
if it's so.

Nick




Re: name sessions in konsole

2004-04-25 Thread Adeodato Simó
* Robert Lindgren [Sun, 25 Apr 2004 19:03:10 +0200]:
> sure is possible:

> add something like:
> PS1="\[\033]0;[EMAIL PROTECTED]: \w\007\]\[\033]30;[EMAIL PROTECTED]: [EMAIL 
> PROTECTED]:\w] "
> to your .bashrc

Thanks, that's something I've always wanted to know. I'll just make
clearer the relevant part:

- change shell's name escape sequence: \033]30;NAME\007

Thanks again.

-- 
Adeodato Simó (a.k.a. thibaut)
EM: asp16 [ykwim] alu.ua.es | IM: my_dato [jabber.org] | PK: DA6AE621
Listening to: Four Tet - Spirit fingers
 
A dream is an answer to a question that we don't know how to ask.


signature.asc
Description: Digital signature


Re: name sessions in konsole

2004-04-25 Thread Bud Rogers
On Sunday 25 April 2004 04:58, Wolfgang Mader wrote:
> Hello,
>
> If you open a new tab for a new session in konsole normaly there
> appears something like "shel"l (or whatever type of session you have
> chosen) on the tab. I am working on different machines and it would
> be nice to have the name of the machine where the shell was opened
> (or much better - where the shell ends actually). Is this possible
> with konsole? Perhaps with output from uname -n?

Right click over the tab, select Rename session, or double click the 
tab.

For the longest time I treated konsole as just another xterm clone.  I 
turned off all the toolbars and tabs to minimize desktop real estate.  
I routinely had a number of separate, overlapping konsoles cluttering 
up my desktop.  Then I "discovered"  what the extra features like tabs 
and bookmarks were good for.

If you use bookmarks in konsole you can set the name that is displayed.  
At work I have bookmarks for most of my servers as well as a number of 
other boxen I deal with regularly.  I typically have one konsole 
running with several  sessions open in different tabs.  Shift-arrow 
toggles between them without leaving the keyboard.  Holding down shift 
and toggling left and right arrows is a quick way to visually see diffs 
between two similar files.

-- 
Bud Rogers  <[EMAIL PROTECTED]>  KD5SZ




Re: name sessions in konsole

2004-04-25 Thread Robert Lindgren
sure is possible:

add something like:
PS1="\[\033]0;[EMAIL PROTECTED]: \w\007\]\[\033]30;[EMAIL PROTECTED]: [EMAIL 
PROTECTED]:\w] "
to your .bashrc

or .tcshrc:
alias precmd 'echo -n "\033]0;${HOST}:$cwd\007\033]30;${HOST}:$cwd\007"'

Note that this should be added on the remote end, and local if you want it 
there too :)

Regards
Robert

On Sunday 25 April 2004 11:58, Wolfgang Mader wrote:
> Hello,
>
> If you open a new tab for a new session in konsole normaly there appears
> something like "shel"l (or whatever type of session you have chosen) on the
> tab. I am working on different machines and it would be nice to have the
> name of the machine where the shell was opened (or much better - where the
> shell ends actually). Is this possible with konsole? Perhaps with output
> from uname -n?
> Thank you
> Wolfgang




name sessions in konsole

2004-04-25 Thread Wolfgang Mader
Hello,

If you open a new tab for a new session in konsole normaly there appears 
something like "shel"l (or whatever type of session you have chosen) on the 
tab. I am working on different machines and it would be nice to have the name 
of the machine where the shell was opened (or much better - where the shell 
ends actually). Is this possible with konsole? Perhaps with output from uname 
-n?
Thank you
Wolfgang