Skip to content

Commit

Permalink
Merge pull request #267 from crierr/master
Browse files Browse the repository at this point in the history
fix: remove shell substitution for compatibility
  • Loading branch information
3rd authored Jan 17, 2025
2 parents f1163cc + 5c5df4a commit a90920a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lua/image/utils/tmux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ local create_dm_getter = function(name)
end
end

local get_current_session = create_dm_getter("client_session")

local create_dm_window_getter = function(name)
return function()
if not is_tmux then return nil end
local result = vim.fn.system(
"tmux list-windows -t $(tmux display-message -p '#{client_session}') -F '#{" .. name .. "}' -f '#{window_active}'"
)
local result =
vim.fn.system("tmux list-windows -t " .. get_current_session() .. " -F '#{" .. name .. "}' -f '#{window_active}'")
return vim.fn.trim(result)
end
end

local create_dm_pane_getter = function(name)
return function()
if not is_tmux then return nil end
local result = vim.fn.system(
"tmux list-panes -t $(tmux display-message -p '#{client_session}') -F '#{" .. name .. "}' -f '#{pane_active}'"
)
local result =
vim.fn.system("tmux list-panes -t " .. get_current_session() .. " -F '#{" .. name .. "}' -f '#{pane_active}'")
return vim.fn.trim(result)
end
end
Expand All @@ -48,7 +48,7 @@ return {
has_passthrough = has_passthrough,
get_pid = create_dm_getter("pid"),
get_socket_path = create_dm_getter("socket_path"),
get_current_session = create_dm_getter("client_session"),
get_current_session = get_current_session,
get_window_id = create_dm_window_getter("window_id"),
get_window_name = create_dm_window_getter("window_name"),
get_pane_id = create_dm_pane_getter("pane_id"),
Expand Down

0 comments on commit a90920a

Please sign in to comment.