创建在屏幕上运行程序的新窗口

发布于 2024-07-25 10:18:13 字数 441 浏览 3 评论 0原文

我的 .screenrc 有一些打开一些窗口的初始化代码。 很整洁。

我想要做的,在运行屏幕时很简单,用一个命令打开一个正在运行程序的新屏幕窗口。

它应该是:

screen -t 'CADMIN' sudo cherokee-admin -b

这实际上有效,除了它还运行我的 .screenrc 并打开我的所有 嵌套屏幕中的窗口。 失败。

我知道我可以使用

^c ( to create a new window )   
^cA ( to title it )   
sudo cherokee-admin -b   

并获得相同的效果,但我想为我的生活带来一点优雅,这 这就是为什么我使用屏幕而不是一些多终端的东西。

有想法吗?

My .screenrc has some initialization code that opens some windows. It's neat.

What I want to do, while running screen is simply , with one command open a new screen window that is running a program.

It SHOULD be:

screen -t 'CADMIN' sudo cherokee-admin -b

This actually works, except that it also runs my .screenrc and opens up all of my
windows in a nested screen. FAIL.

I know I could use

^c ( to create a new window )   
^cA ( to title it )   
sudo cherokee-admin -b   

and get the same effect, but I'd like to bring a little elegance to my life, which
is why I use screen and not some multi terminal thing.

Ideas?

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

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

发布评论

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

评论(2

揪着可爱 2024-08-01 10:18:13

好吧,我得到了一个有点令人满意的答案:

来自 bug 页面 有一个讨论关于使用 screen -t 调用的问题。

我尝试过这个,我发现 screen -c /dev/null -t CADMIN sudo cherokee-admin -b 实际上按照我最初想象的方式工作。 实际上,这很漂亮,-c 没有调用任何 .screenrc 的值,这不会打开我辉煌的屏幕装备。 我可以忍受这个。

Ok, I've got a somewhat palatable answer:

from the bugs page there is a discussion about problems using the screen -t invocation.

I've tried this and I find that screen -c /dev/null -t CADMIN sudo cherokee-admin -b actually works the way I originally thought it would. It's kind of nifty actually, -c calls nothing for the value of .screenrc, which does not open my glorious screen rig. I can live with this.

来世叙缘 2024-08-01 10:18:13

您可以设置另一个 .screenrc 文件,其中不包含所有其他窗口,然后在 .bash_profile 中您可以添加类似以下内容:

alias scn="screen -c '.screenrc2' -t 'CADMIN' sudo cherokee-admin -b"

然后您所要做的就是从 cli 运行 $scn 以使用所需的屏幕打开屏幕影响。

希望这有助于

编辑:确保将第二个 .screenrc 文件命名为不同的名称(即“.screenrc2”)

You could setup another .screenrc file that doesn't have all of the other windows in it then in your .bash_profile you could add something like:

alias scn="screen -c '.screenrc2' -t 'CADMIN' sudo cherokee-admin -b"

then all you would have to do is run $scn from the cli to open screen with the desired effect.

hope this helps

edit: Make sure you name the second .screenrc file something different (i.e. '.screenrc2')

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