Skip to content

Commit ba5ba60

Browse files
phanenibhagwan
authored andcommitted
fix: skim --tmux didn't pass all environemnt variable
But `SKIM_xx`/`RUST_xx` are allowed
1 parent 970fc98 commit ba5ba60

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lua/fzf-lua/fzf.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ function M.raw_fzf(contents, fzf_cli_args, opts)
280280
["FZF_DEFAULT_COMMAND"] = FZF_DEFAULT_COMMAND,
281281
["SKIM_DEFAULT_COMMAND"] = FZF_DEFAULT_COMMAND,
282282
["FZF_LUA_SERVER"] = vim.g.fzf_lua_server,
283+
-- sk --tmux didn't pass all environemnt variable (https://github.com/skim-rs/skim/issues/732)
284+
["SKIM_FZF_LUA_SERVER"] = vim.g.fzf_lua_server,
283285
["VIMRUNTIME"] = vim.env.VIMRUNTIME,
284286
["FZF_DEFAULT_OPTS"] = (function()
285287
-- Newer style `--preview-window` options in FZF_DEFAULT_OPTS such as:

lua/fzf-lua/shell_helper.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ local rpc_nvim_exec_lua = function(opts)
5757
-- for skim compatibility
5858
local preview_lines = vim.env.FZF_PREVIEW_LINES or vim.env.LINES
5959
local preview_cols = vim.env.FZF_PREVIEW_COLUMNS or vim.env.COLUMNS
60-
local chan_id = vim.fn.sockconnect("pipe", vim.env.FZF_LUA_SERVER or vim.env.NVIM, { rpc = true })
60+
local chan_id = vim.fn.sockconnect("pipe", opts.fzf_lua_server, { rpc = true })
6161
vim.rpcrequest(chan_id, "nvim_exec_lua", [[
6262
local luaargs = {...}
6363
local function_id = luaargs[1]
@@ -103,6 +103,7 @@ args[0] = nil -- remove filename
103103
local opts = {
104104
fnc_id = tonumber(table.remove(args, 1)),
105105
debug = table.remove(args, 1) == "true",
106-
fzf_selection = args
106+
fzf_selection = args,
107+
fzf_lua_server = vim.env.FZF_LUA_SERVER or vim.env.SKIM_FZF_LUA_SERVER or vim.env.NVIM,
107108
}
108109
rpc_nvim_exec_lua(opts)

0 commit comments

Comments
 (0)