Skip to content

Commit 9e6320f

Browse files
author
skywind3000
committed
new runner: xterm, try with :AsyncRun -mode=term -pos=xterm ls -la
1 parent 14272f0 commit 9e6320f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

autoload/asyncrun/runner/xterm.vim

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"======================================================================
2+
"
3+
" xterm.vim -
4+
"
5+
" Created by skywind on 2021/12/15
6+
" Last Modified: 2021/12/15 06:37:16
7+
"
8+
"======================================================================
9+
10+
" vim: set ts=4 sw=4 tw=78 noet :
11+
12+
function! asyncrun#runner#xterm#run(opts)
13+
if !executable('xterm')
14+
return asyncrun#utils#errmsg('xterm executable not find !')
15+
endif
16+
let cmds = []
17+
let cmds += ['cd ' . shellescape(getcwd()) ]
18+
let cmds += [a:opts.cmd]
19+
let cmds += ['echo ""']
20+
let cmds += ['read -n1 -rsp "press any key to continue ..."']
21+
let text = shellescape(join(cmds, ";"))
22+
let command = 'xterm '
23+
let command .= ' -T ' . shellescape(':AsyncRun ' . a:opts.cmd)
24+
let command .= ' -e bash -c ' . text
25+
call system(command . ' &')
26+
endfunc
27+
28+

0 commit comments

Comments
 (0)