Renaming a Konsole session from the command line after ssh

I use dcop to rename a Konsole session like

 dcop $KONSOLE_DCOP_SESSION renameSession "whatever" 

However, when I ssh to the server and from there I issue this command, it does not work and gives an error:

 ERROR: Couldn't attach to DCOP server! 

Is there a way to use dcop or otherwise rename a Konsole session, even if I have ssh 'ed for another computer.

+4
source share
1 answer

Dcop does not work on the remote server, and even if it is, it is not the instance you want to communicate with (dcopserver on the remote host vs dcop on the local host).

You can use XTerm escape sequences to change the name with:

 remotehost $ echo -ne "\033]0;Custom Window Title\007" 

You can also change the name of an individual tab with:

 remotehost $ echo -ne "\033]30;Custom Tab Title\007" 

Another way would be to pause the current ssh session so that you return to the initial login.

eg.

 host1 $ ssh host2 host2 $ ~^Z [suspend ssh] [1]+ Stopped ssh host2 host1 $ dcop $KONSOLE_DCOP_SESSION renameSession "whatever" host1 $ fg ssh host2 host2 $ 
+7
source

Source: https://habr.com/ru/post/1389962/


All Articles