| Author |
Message |
Sashi *nix forums addict
Joined: 14 Jun 2005
Posts: 95
|
Posted: Wed Jul 12, 2006 6:42 pm Post subject:
VIM no controlling terminal
|
|
|
All, I'm grepping for a string and want to open all the matching files
using vim. This is what I used:
$ grep -l pat_str *.c | xargs vim
and I got the message: "VIM: no controlling terminal".
Whys is this and can I fix this behavior to do what I want?
TIA,
Sashi |
|
| Back to top |
|
 |
Stachu 'Dozzie' K. *nix forums Guru Wannabe
Joined: 30 Mar 2005
Posts: 250
|
Posted: Wed Jul 12, 2006 6:52 pm Post subject:
Re: VIM no controlling terminal
|
|
|
On 12.07.2006, Sashi <smalladi@gmail.com> wrote:
| Quote: | All, I'm grepping for a string and want to open all the matching files
using vim. This is what I used:
$ grep -l pat_str *.c | xargs vim
and I got the message: "VIM: no controlling terminal".
Whys is this and can I fix this behavior to do what I want?
|
vim `grep -l pat_str *.c`
--
Szukasz dobrego shella? mail | http://marcinhlybin.com/shell/
Stanislaw Klekot |
|
| Back to top |
|
 |
Sashi *nix forums addict
Joined: 14 Jun 2005
Posts: 95
|
Posted: Wed Jul 12, 2006 7:37 pm Post subject:
Re: VIM no controlling terminal
|
|
|
Stachu 'Dozzie' K. wrote:
| Quote: | On 12.07.2006, Sashi <smalladi@gmail.com> wrote:
All, I'm grepping for a string and want to open all the matching files
using vim. This is what I used:
$ grep -l pat_str *.c | xargs vim
and I got the message: "VIM: no controlling terminal".
Whys is this and can I fix this behavior to do what I want?
vim `grep -l pat_str *.c`
--
Szukasz dobrego shella? mail | http://marcinhlybin.com/shell/
Stanislaw Klekot
Thanks! |
But do you know why my attempt failed?
Sashi |
|
| Back to top |
|
 |
Chris Mattern *nix forums Guru Wannabe
Joined: 13 Mar 2005
Posts: 122
|
Posted: Wed Jul 12, 2006 9:40 pm Post subject:
Re: VIM no controlling terminal
|
|
|
Sashi wrote:
| Quote: | Stachu 'Dozzie' K. wrote:
On 12.07.2006, Sashi <smalladi@gmail.com> wrote:
All, I'm grepping for a string and want to open all the matching files
using vim. This is what I used:
$ grep -l pat_str *.c | xargs vim
and I got the message: "VIM: no controlling terminal".
Whys is this and can I fix this behavior to do what I want?
vim `grep -l pat_str *.c`
--
Szukasz dobrego shella? mail | http://marcinhlybin.com/shell/
Stanislaw Klekot
Thanks!
But do you know why my attempt failed?
Sashi
Programs can tell when they've been put in a pipeline. |
Vim (and vi) don't like that, because in that kind
of non-interactive environment, they don't get the
kind of full-screen control they need (hence,
"No controlling terminal"). By rephrasing
the command so that vim is invoked normally
with the shell generating its command
line before invoking it, everything's kosher.
CHris Mattern |
|
| Back to top |
|
 |
Barry Margolin *nix forums Guru
Joined: 24 Feb 2005
Posts: 323
|
Posted: Thu Jul 13, 2006 12:58 am Post subject:
Re: VIM no controlling terminal
|
|
|
In article <1152733043.756598.222730@b28g2000cwb.googlegroups.com>,
"Sashi" <smalladi@gmail.com> wrote:
| Quote: | Stachu 'Dozzie' K. wrote:
On 12.07.2006, Sashi <smalladi@gmail.com> wrote:
All, I'm grepping for a string and want to open all the matching files
using vim. This is what I used:
$ grep -l pat_str *.c | xargs vim
and I got the message: "VIM: no controlling terminal".
Whys is this and can I fix this behavior to do what I want?
vim `grep -l pat_str *.c`
--
Szukasz dobrego shella? mail | http://marcinhlybin.com/shell/
Stanislaw Klekot
Thanks!
But do you know why my attempt failed?
|
Because vim expects its standard input to be a terminal. When you put
it in a pipeline, standard input is the pipe, not the terminal.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group *** |
|
| Back to top |
|
 |
Sashi *nix forums addict
Joined: 14 Jun 2005
Posts: 95
|
Posted: Thu Jul 13, 2006 3:16 pm Post subject:
Re: VIM no controlling terminal
|
|
|
Barry Margolin wrote:
| Quote: | In article <1152733043.756598.222730@b28g2000cwb.googlegroups.com>,
"Sashi" <smalladi@gmail.com> wrote:
Stachu 'Dozzie' K. wrote:
On 12.07.2006, Sashi <smalladi@gmail.com> wrote:
All, I'm grepping for a string and want to open all the matching files
using vim. This is what I used:
$ grep -l pat_str *.c | xargs vim
and I got the message: "VIM: no controlling terminal".
Whys is this and can I fix this behavior to do what I want?
vim `grep -l pat_str *.c`
--
Szukasz dobrego shella? mail | http://marcinhlybin.com/shell/
Stanislaw Klekot
Thanks!
But do you know why my attempt failed?
Because vim expects its standard input to be a terminal. When you put
it in a pipeline, standard input is the pipe, not the terminal.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Thanks, all! |
Sashi |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|