在ssh之后从命令行重命名Konsole会话 [英] Renaming a Konsole session from commandline after ssh

查看:236
本文介绍了在ssh之后从命令行重命名Konsole会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用dcop重命名Konsole会话,例如

I use dcop to rename a Konsole session, such as

dcop $KONSOLE_DCOP_SESSION renameSession "whatever"

但是,当我ssh到服务器并从那里发出命令时,它不起作用并给出错误:

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

ERROR: Couldn't attach to DCOP server!

即使我已经ssh已连接到另一台计算机,也可以使用dcop或其他方式重命名Konsole会话.

Is there a way using dcop or otherwise to rename the Konsole session, even though I have ssh'ed to another computer.

推荐答案

远程服务器似乎未在运行dcop,即使已运行,也不是要与之通信的实例(远程主机上的dcopserver与dcop上的您的本地主机).

The remote server appears not be running dcop and even if it were, that's not the instance you want to be communicating with (dcopserver on the remote host vs dcop on your local host).

您可以使用XTerm转义序列通过以下方式更改标题:

You can use XTerm escape sequences to change the title via:

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

您还可以通过以下方式更改单个标签的标题:

You can also change the individual tab title via:

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

另一种方法是挂起当前的ssh会话,以使您返回到您启动的登录名.

Another way would be to suspend your current ssh session so that you are back at the login you started.

例如

host1 $ ssh host2
host2 $ ~^Z [suspend ssh]

[1]+  Stopped                 ssh host2
host1 $ dcop $KONSOLE_DCOP_SESSION renameSession "whatever"
host1 $ fg
ssh host2
host2 $ 

这篇关于在ssh之后从命令行重命名Konsole会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆