0
ssh machineb "vim /etc/sysconfig/iptables"

I get the following as a transient message:

Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal

Then, I see the file I requested, and it looks like I am editing it, except I can't input some characters, such as the ESC character. I see "^[" instead. Also, it looks like ENTER is now going down a line in the "vim over ssh" (as if I pressed j). Other weird things seem to happen too, I think I see a message about the file being readonly and something about "Process ID: XXXX (still running)" -- overlaid on top of my file. I only get out of this weird state by pressing Ctrl-Z.

Seems like maybe something like readline is broken? Is this related to my shell's input and output files? If so, how?

Just a curious enthusiast, trying to understand what went down. Do you have any feelings about why this is a dumb thing to do that you'd like to tell me? Would it ever make sense to do something like this, and is there a way to achieve it more successfully?

Brian Peterson
  • 2,800
  • 6
  • 29
  • 36
  • 1
    How come you don't just first ssh to the terminal, then open the file with vim once you're connected? – mattb Apr 26 '21 at 16:55
  • I could do that. I was mostly curious about vim's message about the terminal's input and output because I have never fully grokked some issues related to input and output that I thought might become clearer if I understand this weird example. – Brian Peterson Apr 26 '21 at 16:59
  • https://stackoverflow.com/search?q=%5Bssh%5D+%5Bvim%5D+Warning%3A+Output+is+not+to+a+terminal+ – phd Apr 26 '21 at 17:06
  • Yeah, that's a great resource for what I was looking at, thanks! Pseudo-tty is the concept I wanted to understand better in this case, I guess. I will have to do some reading. – Brian Peterson Apr 26 '21 at 17:12

0 Answers0