为什么新终端会自动关闭?

为什么新终端会自动关闭?

每次我打开新终端时,它都会自动关闭。我正在运行 Arch Linux 和 Xforce4 终端。

$ terminal --execute sudo arpspoof -i $(cat var.log|awk '{print $1}') \
           -t $(cat var.log|awk '{print $4}') $(cat var.log|awk '{print $3}')

或者

# terminal --execute arpspoof -i $(cat var.log|awk '{print $1}') \
           -t $(cat var.log|awk '{print $4}') $(cat var.log|awk '{print $3}')

执行上述任一命令时都会打印错误:

Unable to register terminal service: Did not receive a reply. Possible causes
include: the remote application did not send a reply, the message bus security
policy blocked the reply, the reply timeout expired, or the network connection
was broken.

答案1

终端的“默认”行为是在指示其运行的程序完成时终止。它这样做是因为这是最实际的做法。如果您希望在输出消失之前读取它,请考虑在末尾添加一个命令,如下所示:

urxvt -e sh -c 'cowsay howdy?; sleep 1337'

某些终端(例如 rxvt-unicode)具有挂起直到窗口管理器关闭的选项:

-hold|+hold
    Turn on/off hold window after exit support. If enabled, urxvt will 
    not immediately destroy its window when the program executed within 
    it exits.  Instead, it will wait till it is being killed or closed by 
    the user; resource hold.

相关内容