Skip to content

Commit c0fd6ff

Browse files
committed
Spawn tmux fg job in bg window when height is 0
When the requested height for a tmux split is 0 and that the spawned job will be able to call back, spawn the foreground job in a new background window, just as if it were a background job Note that setting the height to 0 behaves gracefully even when no callback mechanism is available since "split-window -l 0" creates a two lines split (with tmux 2.5 to 2.7 at least)
1 parent 1ea256e commit c0fd6ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/dispatch/tmux.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function! dispatch#tmux#make(request) abort
4949

5050
let title = shellescape(get(a:request, 'title', get(a:request, 'compiler', 'make')))
5151
let height = get(g:, 'dispatch_tmux_height', get(g:, 'dispatch_quickfix_height', 10))
52-
if get(a:request, 'background', 0)
52+
if get(a:request, 'background', 0) || (height <= 0 && dispatch#has_callback())
5353
let cmd = 'new-window -d -n '.title
5454
elseif has('gui_running') || empty($TMUX) || (!empty(''.session) && session !=# system('tmux display-message -p "#S"')[0:-2])
5555
let cmd = 'new-window -n '.title

0 commit comments

Comments
 (0)