How can I force `vagrant ssh` to do pseudo-tty allocation?

半城伤御伤魂 提交于 2019-12-19 10:25:40

问题


The first thing I do after vagrant ssh is usually attaching to a tmux session.

I want to automate this, so I try: vagrant ssh -c "tmux attach", but it fails and says "not a terminal".

After some googling I find this article and know that I should force a pseudo-tty allocation before executing a screen-based program, and it can be done with the -t option of ssh.

But I don't know how to use this option with vagrant ssh.


回答1:


According to this documentation, you should try adding -- to the command.
As I have not used vagrant, I am unsure of the formatting, but assume it would be similar to:

vagrant ssh -- -t

Unless, you need to include the username and host, in which case add the username and host.



来源:https://stackoverflow.com/questions/16513513/how-can-i-force-vagrant-ssh-to-do-pseudo-tty-allocation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!