mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-26 20:16:32 +00:00
Avoid control characters in Neovim terminal buffer name
- With 'title', run command from temp script if it has control chars - Raw ESC in buffer name leaked through title and drew garbage Fix #4941
This commit is contained in:
1 file changed
+6
@@ -1104,6 +1104,12 @@ function! s:execute_term(dict, command, temps) abort
|
|||||||
let fzf.temps.batchfile = s:fzf_tempname().'.bat'
|
let fzf.temps.batchfile = s:fzf_tempname().'.bat'
|
||||||
call s:writefile(s:wrap_cmds(a:command), fzf.temps.batchfile)
|
call s:writefile(s:wrap_cmds(a:command), fzf.temps.batchfile)
|
||||||
let command = fzf.temps.batchfile
|
let command = fzf.temps.batchfile
|
||||||
|
elseif has('nvim') && &title && a:command =~ '[[:cntrl:]]'
|
||||||
|
" Neovim puts the command in the buffer name, which can end up raw in
|
||||||
|
" the terminal title (#4941)
|
||||||
|
let fzf.temps.shellscript = s:fzf_tempname()
|
||||||
|
call s:writefile([a:command], fzf.temps.shellscript)
|
||||||
|
let command = 'sh '.fzf#shellescape(fzf.temps.shellscript)
|
||||||
else
|
else
|
||||||
let command = a:command
|
let command = a:command
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in new issue
Block a user