File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,15 @@ local mux_utils = require('smart-splits.mux.utils')
26
26
--- @field ignored_events string[]
27
27
--- @field multiplexer_integration SmartSplitsMultiplexerType | false
28
28
--- @field disable_multiplexer_nav_when_zoomed boolean
29
+ --- @field wezterm_cli_path string | nil
29
30
--- @field kitty_password string | nil
30
31
--- @field setup fun ( cfg : table )
31
32
--- @field set_default_multiplexer fun (): string | nil
32
33
--- @field log_level ' trace' | ' debug' | ' info' | ' warn' | ' error' | ' fatal'
33
34
34
35
--- @type SmartSplitsConfig
35
36
local config = { --- @diagnostic disable-line : missing-fields
37
+ wezterm_cli_path = ' wezterm' ,
36
38
ignored_buftypes = {
37
39
' nofile' ,
38
40
' quickfix' ,
109
111
function M .setup (new_config )
110
112
local original_mux = config .multiplexer_integration
111
113
114
+ if mux_utils .is_WSL () then
115
+ -- on WSL default to .exe unless explicitly set in user config
116
+ new_config .wezterm_cli_path = new_config .wezterm_cli_path or ' wezterm.exe'
117
+ end
118
+
112
119
config = vim .tbl_deep_extend (' force' , config , new_config or {})
113
120
-- if the mux setting changed, run startup again
114
121
if
Original file line number Diff line number Diff line change @@ -9,6 +9,21 @@ function M.are_we_tmux()
9
9
return term == ' tmux'
10
10
end
11
11
12
+ function M .are_we_wezterm ()
13
+ if M .are_we_gui () then
14
+ return false
15
+ end
16
+
17
+ local term = vim .trim ((vim .env .TERM_PROGRAM or ' ' ):lower ())
18
+ return term == ' wezterm'
19
+ end
20
+
21
+ --- Check if we're in WSL
22
+ --- @return boolean
23
+ function M .is_WSL ()
24
+ return vim .env .WSL_DISTRO_NAME ~= nil and vim .env .WSL_DISTRO_NAME ~= ' '
25
+ end
26
+
12
27
--- Check if Neovim is running in a GUI (rather than TUI)
13
28
--- @return boolean
14
29
function M .are_we_gui ()
Original file line number Diff line number Diff line change 1
1
local Direction = require (' smart-splits.types' ).Direction
2
+ local config = require (' smart-splits.config' )
2
3
3
4
local dir_keys_wezterm = {
4
5
[Direction .left ] = ' Left' ,
@@ -16,7 +17,7 @@ local dir_keys_wezterm_splits = {
16
17
17
18
local function wezterm_exec (cmd )
18
19
local command = vim .deepcopy (cmd )
19
- table.insert (command , 1 , ' wezterm ' )
20
+ table.insert (command , 1 , config . wezterm_cli_path )
20
21
table.insert (command , 2 , ' cli' )
21
22
return vim .fn .system (command )
22
23
end
You can’t perform that action at this time.
0 commit comments