Vim Input is not from a terminal [duplicate]

断了今生、忘了曾经 提交于 2019-12-10 01:43:03

问题


which django-admin.py | vim
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: Finished.

What is the easiest way to fix this? And actually make vim to open "/usr/local/bin/django-admin.py"

Essentially I want to host an auto-install customized vim on my personal blog: http://wayneye.com/vim, you can see the shell script by navigating to it, it just contains the following commands:

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim \
curl -L -o ~/.vimrc https://raw.githubusercontent.com/WayneYe/WayneDevLab/master/wayne.vimrc \
vim +PluginInstall

But when I do curl http://wayneye.com/vim | sh, I got the "input not from terminal error", how can I fix that please?


回答1:


In order for you to read from stdin you need to tell VIM explicitly to do that by using the - parameter at the commandline.

So in your case, this should work:

which django-admin.py | vim -

Quick question though, when you use which with a filename, do you expect it to show you the path or is django-admin.py an executable that exists in path? In which case, you're fine.




回答2:


You can try the following:

% vim "$(which django-admin.py)"

It should work, as long as django-admin.py is actually found by which command and it is not aliased.




回答3:


A very simple way to do this:

vim `which django-admin.py`


来源:https://stackoverflow.com/questions/24281304/vim-input-is-not-from-a-terminal

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