Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Vim From PHP CLI

Tags:

php

vim

How do you open up vim from a CLI like svn and git do when you drop -m from commit commands?

I'm getting the follow error: Vim: Warning: Output is not to a terminal

`echo "Please edit this file" > file.name`;
`vim file.name`;
like image 703
Logan Bailey Avatar asked Sep 02 '25 04:09

Logan Bailey


1 Answers

PHP Doesn't automatically pass thru the STDIN/STDOUT streams, you need to do it manually:

`echo "Please edit this file" > file.name`;
system("vim file.name > `tty`");

(Note: I don't really understand what I'm talking about, I just know the above works.)

like image 114
too much php Avatar answered Sep 04 '25 19:09

too much php