gpt4 book ai didi

shell - tmux 打开终端失败 : not a terminal

转载 作者:行者123 更新时间:2023-12-03 13:56:17 26 4
gpt4 key购买 nike

我有一个 shell 脚本,它被启用为服务来启动多个 shell 脚本,例如

service started script -> script1, script2 ,script3 

script1 应该在 tmux 窗口中打开一个程序,如果我通过 ./script1.sh 手动启动脚本,它确实可以正常工作。 ,但是当通过服务启动脚本启动时,它不会出现上述错误:
open terminal failed: not a terminal

为什么会这样?

最佳答案

已有答案here ,但是 this link我认为总结得更好。简而言之,使用 -t旗帜:

ssh -t host tmux attach

如果你想把它设置成你的 .ssh/config文件,查看 ssh_config RequestTTY 的联机帮助页选项:
 RequestTTY
Specifies whether to request a pseudo-tty for the session. The
argument may be one of: ``no'' (never request a TTY), ``yes''
(always request a TTY when standard input is a TTY), ``force''
(always request a TTY) or ``auto'' (request a TTY when opening a
login session). This option mirrors the -t and -T flags for
ssh(1).

关于shell - tmux 打开终端失败 : not a terminal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25207909/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com