Linux gedit 和终端
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11007086/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linux gedit and the terminal
提问by CodeKingPlusPlus
Whenever I am using gedit to write code I can access either gedit or the terminal but not both. For example, when I type gedit hello.c linux brings up the file hello.c inside gedit. Now, while gedit is still displaying hello.c I cannot type anything into the terminal without closing hello.c in gedit.
每当我使用 gedit 编写代码时,我都可以访问 gedit 或终端,但不能同时访问两者。例如,当我输入 gedit hello.c 时,linux 会在 gedit 中打开文件 hello.c。现在,当 gedit 仍然显示 hello.c 时,我无法在不关闭 gedit 中的 hello.c 的情况下在终端中输入任何内容。
How can I get around this so that I may actively use both the terminal and gedit simultaneously?
我该如何解决这个问题,以便我可以同时主动使用终端和 gedit?
Thanks
谢谢
采纳答案by Eric Fortis
type gedit hello.c &
类型 gedit hello.c &
or if you have already typed it without the ampersand press Ctrl+ Zto send it to background, and type bg
to enable gedit as David pointed out.
或者,如果您已经输入了它而没有 & 号,请按Ctrl+Z将其发送到后台,然后输入bg
以启用 gedit,正如大卫所指出的那样。
回答by K1773R
if you already started gedit, press CTRL + Z, then type
如果您已经启动 gedit,请按 CTRL + Z,然后键入
bg && disown
dis will run gedit in background and disown it from the terminal (so gedit wont die if you close the terminal)
dis 将在后台运行 gedit 并从终端中取消它(因此如果关闭终端,gedit 不会死)