jcjordyn140 / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Odd issue when calling cygstart from vim #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add the following to .vimrc:
function! MSDNLookup(keyword)
        silent execute ':!cygstart http://www.google.com/microsoft?
hl=en&q='.a:keyword.'&btnG=Search'
endfunction
nnoremap <F3> :call MSDNLookup(expand("<cword>"))<CR>
2. Cursor over a function (swprintf for example)
3. Press <F3>

What is the expected output? What do you see instead?
I expect to have the terminal unaffected and the default browser to launch 
with the appropriate URL.  Instead, the terminal goes completely black, the 
browser launches, but the URL is truncated to 
'http://www.google.com/microsoft?hl=en'

What version of the product are you using? On what operating system?
MinTTY 0.3.5.

Please provide any additional information below.

Original issue reported on code.google.com by ir0nh...@gmail.com on 12 Mar 2009 at 3:24

GoogleCodeExporter commented 9 years ago
I don't see why this is meant to be a mintty issue. I'd suspect the '&' in the
address is being interpreted by the shell as the control operator for background
processes.

Original comment by andy.koppe on 12 Mar 2009 at 10:30

GoogleCodeExporter commented 9 years ago
That would explain the truncated URL, but why does MinTTY screen blank out 
completely?  This doesn't occur when Cygwin is run in a Command Prompt or rxvt.

Original comment by ir0nh...@gmail.com on 12 Mar 2009 at 7:58

GoogleCodeExporter commented 9 years ago
I've escaped the '&' characters, and the URL is no longer truncated, but MinTTY 
still 
blanks out the screen, where as Cygwin Command Prompt (Cygwin in cmd.exe) and 
rxvt do 
not.

Original comment by ir0nh...@gmail.com on 12 Mar 2009 at 8:02

GoogleCodeExporter commented 9 years ago
Just tried it with xterm, and it's the same behaviour there, and of course 
mintty is
meant to be compatible with xterm. Sorry, but I don't know why executing 
cygstart
would have that effect on vim.

Original comment by andy.koppe on 12 Mar 2009 at 8:17

GoogleCodeExporter commented 9 years ago
Thankfully it's easy to workaround by pressing Page-Up or Page-Down, which I 
guess in 
vim forces a screen refresh.

Original comment by ir0nh...@gmail.com on 13 Mar 2009 at 2:02

GoogleCodeExporter commented 9 years ago
Just as an FYI, in case someone has this issue, I was able to fix it by adding 
'normal ^L' in my vim function to force a screen refresh.  As a result, it 
becomes:

function! MSDNLookup(keyword)
    silent execute ':!cygstart 
http://www.google.com/microsoft?hl=en\&q='.a:keyword.'\&btnG=Search'
    normal ^L
endfunction
nnoremap <F3> :call MSDNLookup(expand("<cword>"))<CR>

Cheers!

Original comment by ir0nh...@gmail.com on 13 Mar 2009 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 6 Mar 2010 at 5:16