-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search results leak into terminal #18
Comments
Same here (on debian lenny) but no problem with MVim. |
Happens to me also when running in a terminal. My entire screen flashes the output of Ack then back to Vim again. Rather distracting. |
Happen to me on terminal vim, is there any fix for this? |
+1 on this issue too. Only in vim not MacVim. |
Just ran into this too; on iTerm2 with vim 7.3 |
+1 same problem here. Output is something like: [2] + 29217 suspended (tty output) |
+1 same here. vim 7.3 in iTerm2. |
+1, also on iTerm2 with Vim 7.3. |
I'm experiencing the same issue, any idea what is causing that? |
+1, also on iTerm2 with Vim 7.3. |
+1 Same issue here. |
I'm seeing it as well. I will look into it as soon as I can. If someone else has code that fixes it immediately, please note it here. |
+1 I'm on Ubuntu 12.04, gnome terminal and vim 7.3 |
This fixed it for me. Thanks to ZyX in stack overflow: http://stackoverflow.com/questions/13322161/ack-in-terminal-vim-is-flashing-its-output-before-presenting-search-results-ho/13322352#13322352
Pull request: #52 |
@rvega It is bad idea to unconditionally use this fix: it is non-crossplatform, even on linux it may be wrong depending on value of the |
We should definitely try to find a cross-platform solution. |
ZyX-I, do you know in what instances specifically this will fail? What is the result of a failure? For instance, will one simply continue seeing the current odd behavior, or does it crash hard? |
With
It does not crash. Nor it does work, none of the variants result in target file being written to. This is a thing that is supposed to be fixed in vimrc, if you are absolutely sure nobody needs viewing command output temporary before ack finishes you should switch to I definitely have no idea how such |
On Kubuntu 12.04 I see the flashing regardless of whether I'm using vim in the terminal or start gvim from krunner, and after flashing my top buffer has already been changed to show the top result. |
In OSX 10.6 I've been having the same problems. In the terminal it will background vim while running the ack command. In MacVim it will just freeze until I quit (MacVim, not the command). Different terminals and shells make no difference. |
On my system (Linux, zsh) simple setting |
Thanks for the advice @Kagami. However, it didn't work for me (on OSX 10.8.2 using zsh). |
It's a default behaviour on vim use the same terminal session where vim was open to run system commands, with that when you closes vim the output of ran commands will be on terminal. To change this vim's default behaviour use: |
In that case, does preserving the values This just occurred to me and I haven't dig into the possibility, so I'm sorry if I'm just showing stupidity. |
This is still an issue for me. |
@Kagami that worked for me- thanks! |
I just installed the plugin and I notice I actually have this problem. Using vim on mac
Can someone confirm this and maybe reopen the issue? |
Same issue for me with vim 8 on mac |
@skamsie Just added that |
I have this issue as well, output is printed on the screen and distracts a lot. neovim, osx, iterm |
Adding I ended up writing a Vimscript function that takes in the search param and makes sure to set/unset shellpipe properly: function! Search(string)
set shellpipe=>
execute "Ack! \"" . a:string . "\""
set shellpipe=2>&1\|tee
endfunction
nnoremap <C-F> :call Search("")<left><left> EDIT: Looks like @ZyX-I pointed out a couple issues with my implementation. I'm not very well-versed in Vimscript, so thanks for the help! 😄 |
@jonathankau This can hardly be considered “properly”. Correct variant is using 1. original function Search(string) abort
let saved_shellpipe = &shellpipe
let &shellpipe = '>'
try
execute 'Ack!' shellescape(a:string, 1)
finally
let &shellpipe = saved_shellpipe
endtry
endfunction . Note though that I may be incorrect regarding escaping here though: it is definitely correct variant for |
@jonathankau Thank you! It works. |
I wouldn't say it fixes mileszs#18 and mileszs#52, but it builds on them. It avoids the compatibility woes, but only using the shell trick if the shell is bash or zsh. Otherwise it does the t_te/i swapping. Both are not very neat, and make this function messier, but making 3 separate functions seemed a lot more busy work.
When I run vim from OS X's (10.6.7) Terminal or iTerm apps and use the
Ack
command it works as expected, but upon closing vim all of the search results have been printed in the terminal window.This does not occur when using MacVim even if it is launched via the
mvim
command.The text was updated successfully, but these errors were encountered: