Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim Input is not from a terminal [duplicate]

Tags:

terminal

vim

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?

like image 871
Wayne Ye Avatar asked Jun 18 '14 09:06

Wayne Ye


3 Answers

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.

like image 111
Shrayas Avatar answered Nov 02 '22 19:11

Shrayas


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.

like image 28
Alex Gidan Avatar answered Nov 02 '22 21:11

Alex Gidan


A very simple way to do this:

vim `which django-admin.py`
like image 44
FlogFR Avatar answered Nov 02 '22 20:11

FlogFR