有没有办法在 Gnu Screen 中动态更新窗口名称?

发布于 2024-10-09 07:29:55 字数 90 浏览 0 评论 0原文

我想要 Gnu Screen 在当前目录之后动态重命名当前 Screen 窗口。有什么办法让 Screen 做到这一点吗?如果需要修补源代码,我想知道这是唯一的选择。

I want to Gnu Screen to dynamically rename the current Screen window after the current directory. Is there any way to get Screen to do this? If it requires patching the source, I'd like to know that's the only option.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甩你一脸翔 2024-10-16 07:29:55

这似乎确实是可能的,请查看 Automagic 屏幕窗口标题和屏幕手册中的动态标题部分。

This is indeed seems to be possible, check out Automagic screen window titles and Dynamic Titles section from the screen manual.

橘香 2024-10-16 07:29:55

此函数将为您提供一个命令调用title,然后您可以使用它来更改屏幕窗口标题。

title() { printf 

如果您使用的是不错的 shell(例如 zsh),您可以使用 precmdprexec 钩子,您可以在命令之前和之后运行任何命令。迅速的。我建议您使用它们来更新窗口标题。

从以下位置找到的信息将上述内容修补在一起: GNU Screen: Title Examples

(抱歉,简短回答,我有点匆忙,稍后可能会扩展。)

\ek%s\e\\' "$1"; }

如果您使用的是不错的 shell(例如 zsh),您可以使用 precmdprexec 钩子,您可以在命令之前和之后运行任何命令。迅速的。我建议您使用它们来更新窗口标题。

从以下位置找到的信息将上述内容修补在一起: GNU Screen: Title Examples

(抱歉,简短回答,我有点匆忙,稍后可能会扩展。)

This function will give you a command call title which you can then use to change the screen window title.

title() { printf 

If you're using a decent shell (like zsh) you have precmd and prexec hooks from which you can run any command before and after a prompt. I suggest you use these to update the window title.

Patched the above together from info found on: GNU Screen: Title Examples

(Sorry, brief answer, I'm in a bit of a hurry and might expand this later.)

\ek%s\e\\' "$1"; }

If you're using a decent shell (like zsh) you have precmd and prexec hooks from which you can run any command before and after a prompt. I suggest you use these to update the window title.

Patched the above together from info found on: GNU Screen: Title Examples

(Sorry, brief answer, I'm in a bit of a hurry and might expand this later.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文