@@ -2,14 +2,14 @@ local is_tmux = vim.env.TMUX ~= nil
2
2
3
3
local has_passthrough = false
4
4
if is_tmux then
5
- local ok , result = pcall (vim .fn .system , " tmux show -Apv allow-passthrough" )
5
+ local ok , result = pcall (vim .fn .system , { " tmux" , " show" , " -Apv" , " allow-passthrough" } )
6
6
if ok and (result :sub (- 3 ) == " on\n " or result :sub (- 4 ) == " all\n " ) then has_passthrough = true end
7
7
end
8
8
9
9
local create_dm_getter = function (name )
10
10
return function ()
11
11
if not is_tmux then return nil end
12
- local result = vim .fn .system (" tmux display-message -p ' #{" .. name .. " }' " )
12
+ local result = vim .fn .system ({ " tmux" , " display-message" , " -p " , " #{" .. name .. " }" } )
13
13
return vim .fn .trim (result )
14
14
end
15
15
end
@@ -19,17 +19,33 @@ local get_current_session = create_dm_getter("client_session")
19
19
local create_dm_window_getter = function (name )
20
20
return function ()
21
21
if not is_tmux then return nil end
22
- local result =
23
- vim .fn .system (" tmux list-windows -t " .. get_current_session () .. " -F '#{" .. name .. " }' -f '#{window_active}'" )
22
+ local result = vim .fn .system ({
23
+ " tmux" ,
24
+ " list-windows" ,
25
+ " -t" ,
26
+ get_current_session (),
27
+ " -F" ,
28
+ " #{" .. name .. " }" ,
29
+ " -f" ,
30
+ " #{window_active}" ,
31
+ })
24
32
return vim .fn .trim (result )
25
33
end
26
34
end
27
35
28
36
local create_dm_pane_getter = function (name )
29
37
return function ()
30
38
if not is_tmux then return nil end
31
- local result =
32
- vim .fn .system (" tmux list-panes -t " .. get_current_session () .. " -F '#{" .. name .. " }' -f '#{pane_active}'" )
39
+ local result = vim .fn .system ({
40
+ " tmux" ,
41
+ " list-panes" ,
42
+ " -t" ,
43
+ get_current_session (),
44
+ " -F" ,
45
+ " #{" .. name .. " }" ,
46
+ " -f" ,
47
+ " #{pane_active}" ,
48
+ })
33
49
return vim .fn .trim (result )
34
50
end
35
51
end
@@ -39,7 +55,7 @@ local escape = function(sequence)
39
55
end
40
56
41
57
local get_version = function ()
42
- local result = vim .fn .system (" tmux -V" )
58
+ local result = vim .fn .system ({ " tmux" , " -V" } )
43
59
return result :match (" tmux (%d+%.%d+)" )
44
60
end
45
61
0 commit comments