Re: Opening new cygwin window with arguments
Gary Johnson garyjohn at spocom.com writes: mintty -e tail -f foo The -e is optional, but I like keeping my mintty commands consistent with those I write for other terminals. HTH, Gary This is very close, but I need it to start in ANSI mode (--login -i seems to do it in cygwin.bat) so I can color-code the tail. Is there any way to open bash with -- login -i or some other way of enabling ANSI in the new terminal? -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 2012-01-17, Jon Hughes wrote: Gary Johnson garyjohn at spocom.com writes: mintty -e tail -f foo The -e is optional, but I like keeping my mintty commands consistent with those I write for other terminals. HTH, Gary This is very close, but I need it to start in ANSI mode (--login -i seems to do it in cygwin.bat) so I can color-code the tail. Is there any way to open bash with -- login -i or some other way of enabling ANSI in the new terminal? I'm afraid I don't understand the problem. Color _is_ enabled in the new terminal. As an experiment/demonstration, I executed this command in my home directory which happened to contain a text file, ls.out, in which the word out appeared on a few lines. mintty -h a grep --color=always out ls.out The word out was colored in the new terminal just as I would expect it to be. What command are you executing that has colored output when executed at the command line but not when executed as an argument to mintty? Regards, Gary -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
Gary Johnson garyjohn at spocom.com writes: I'm afraid I don't understand the problem. Color _is_ enabled in the new terminal. As an experiment/demonstration, I executed this command in my home directory which happened to contain a text file, ls.out, in which the word out appeared on a few lines. mintty -h a grep --color=always out ls.out The word out was colored in the new terminal just as I would expect it to be. What command are you executing that has colored output when executed at the command line but not when executed as an argument to mintty? Regards, Gary This is the command I'm using: tail -f /foo/test.log | perl -pe 's/error/\e[1;31;43m$\e[0m/g' When I do the following there is no color: mintty -h a tail -f /foo/test.log | grep --color=always error Your command does work correctly (to color based on a grep command parent, rather than chained) but I'm not sure how to correctly modify it to use tail while still coloring the errors. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 2012-01-17, Jon Hughes wrote: Gary Johnson garyjohn at spocom.com writes: I'm afraid I don't understand the problem. Color _is_ enabled in the new terminal. As an experiment/demonstration, I executed this command in my home directory which happened to contain a text file, ls.out, in which the word out appeared on a few lines. mintty -h a grep --color=always out ls.out The word out was colored in the new terminal just as I would expect it to be. What command are you executing that has colored output when executed at the command line but not when executed as an argument to mintty? Regards, Gary This is the command I'm using: tail -f /foo/test.log | perl -pe 's/error/\e[1;31;43m$\e[0m/g' When I do the following there is no color: mintty -h a tail -f /foo/test.log | grep --color=always error Your command does work correctly (to color based on a grep command parent, rather than chained) but I'm not sure how to correctly modify it to use tail while still coloring the errors. The problem is that the shell parses that line as execute mintty and pipe its standard output to grep. The standard output of tail is not being filtered and perl is not being fed anything. One way to solve that is to write your command like this: mintty sh -c tail -f /foo/test.log | perl -pe 's/error/\e[1;31;43m$\e[0m/g' HTH, Gary -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 12 January 2012 03:07, Jon Hughes wrote: What I want to do is open a new cygwin window with a tail command, so I have the parent process still running, and this runoff process in another window. I've found cygstart, but I can't figure out the syntax to do essentially this: cygstart sh tail -f foo Just do: cygstart tail -f foo This works because Windows automatically creates a console window for programs that need one, i.e. you don't need sh in there. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 1/11/2012 10:38 PM, Paul Allen Newell wrote: On 1/11/2012 10:26 PM, Daniel Colascione wrote: Are you using Cygwin vim or a native win32 vim? Win32 console programs generally aren't happy in mintty, and you should use their Cygwin equivalents. Daniel: Thanks for the prompt reply. I just did a which on vim and can see that it is referencing /cygdrive/c/Program Files/Vim/vim72/vim. My bad as I should have checked that .. I somehow was convinced that I had gotten a vim from cygwin setup. Let me correct that and see if things work. Once again, thanks, Paul Daniel: Installing and running /usr/bin/vim sure works alot better ... thanks for pointing out my oversight. Things are a bit screwy on the Windows side, but that's not a Cygwin issue. Paul -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Opening new cygwin window with arguments
What I want to do is open a new cygwin window with a tail command, so I have the parent process still running, and this runoff process in another window. I've found cygstart, but I can't figure out the syntax to do essentially this: cygstart sh tail -f foo Any help would be appreciated -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 2012-01-11, Jon Hughes wrote: What I want to do is open a new cygwin window with a tail command, so I have the parent process still running, and this runoff process in another window. I've found cygstart, but I can't figure out the syntax to do essentially this: cygstart sh tail -f foo Any help would be appreciated mintty -e tail -f foo The -e is optional, but I like keeping my mintty commands consistent with those I write for other terminals. HTH, Gary -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 1/11/12 7:07 PM, Jon Hughes wrote: What I want to do is open a new cygwin window There's no such thing as a cygwin window. Do you mean a mintty instance? with a tail command, so I have the parent process still running, and this runoff process in another window. I've found cygstart, but I can't figure out the syntax to do essentially this: cygstart sh tail -f foo Any help would be appreciated You want to run: mintty -e tail /your/file/here (Note that it's _not_ -e tail /your/file/here. -e works a bit like cmd.exe's /c flag in that it interprets all following arguments as part of the command to run.) signature.asc Description: OpenPGP digital signature
Re: Opening new cygwin window with arguments
On 1/11/2012 7:37 PM, Gary Johnson wrote: mintty -e tail -f foo The -e is optional, but I like keeping my mintty commands consistent with those I write for other terminals. HTH, Gary I am using cygwin 1.7.9-1 per cygcheck. I tried using mintty and it looks better than the default window the launching cygwin puts up. But I noticed that if I vim a file, nothing happens. When I control-C out, I can see that actually something did happen as there is a .whatever.swp file created. For the heck of it, I tried under an x shell (?hope I have my terminology right?) via startxwin and had the same vim experience (no file opening but a swp file left). Is this one of these situations where I need to find a gvim and use that? I see under setup that there is a gvim 7.3.353.1 available, but wanted to make sure this was the advised solution before adding it. Thanks in advance, Paul -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Opening new cygwin window with arguments
On 1/11/12 10:22 PM, Paul Allen Newell wrote: On 1/11/2012 7:37 PM, Gary Johnson wrote: mintty -e tail -f foo The -e is optional, but I like keeping my mintty commands consistent with those I write for other terminals. HTH, Gary I am using cygwin 1.7.9-1 per cygcheck. I tried using mintty and it looks better than the default window the launching cygwin puts up. But I noticed that if I vim a file, nothing happens. When I control-C out, I can see that actually something did happen as there is a .whatever.swp file created. For the heck of it, I tried under an x shell (?hope I have my terminology right?) via startxwin and had the same vim experience (no file opening but a swp file left). Are you using Cygwin vim or a native win32 vim? Win32 console programs generally aren't happy in mintty, and you should use their Cygwin equivalents. signature.asc Description: OpenPGP digital signature
Re: Opening new cygwin window with arguments
On 1/11/2012 10:26 PM, Daniel Colascione wrote: On 1/11/12 10:22 PM, Paul Allen Newell wrote: On 1/11/2012 7:37 PM, Gary Johnson wrote: mintty -e tail -f foo The -e is optional, but I like keeping my mintty commands consistent with those I write for other terminals. HTH, Gary I am using cygwin 1.7.9-1 per cygcheck. I tried using mintty and it looks better than the default window the launching cygwin puts up. But I noticed that if I vim a file, nothing happens. When I control-C out, I can see that actually something did happen as there is a .whatever.swp file created. For the heck of it, I tried under an x shell (?hope I have my terminology right?) via startxwin and had the same vim experience (no file opening but a swp file left). Are you using Cygwin vim or a native win32 vim? Win32 console programs generally aren't happy in mintty, and you should use their Cygwin equivalents. Daniel: Thanks for the prompt reply. I just did a which on vim and can see that it is referencing /cygdrive/c/Program Files/Vim/vim72/vim. My bad as I should have checked that .. I somehow was convinced that I had gotten a vim from cygwin setup. Let me correct that and see if things work. Once again, thanks, Paul -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple