创建在屏幕上运行程序的新窗口
我的 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我得到了一个有点令人满意的答案:
来自 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.您可以设置另一个 .screenrc 文件,其中不包含所有其他窗口,然后在 .bash_profile 中您可以添加类似以下内容:
然后您所要做的就是从 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:
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')