wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

SpawnTab isn't going to wsl home directory

Open WTanardi opened this issue 6 months ago • 1 comments

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20240730-082727-56a27e93

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Hi, I'm using WSL and I'm trying to ditch Tmux and use wezterm as my multiplexer, the problem is that when I spawn new tab, it doesn't go to my WSL home directory, but goes to the home directory of the windows machine, I've tried setting the spawntab args to both CurrentPaneDomain and DefaultDomain and it does the same thing image

To Reproduce

No response

Configuration

local wezterm = require("wezterm")
local config = wezterm.config_builder()

config.default_domain = "WSL:Ubuntu"

-- Start maximized
local mux = wezterm.mux
wezterm.on("gui-startup", function(cmd)
	local tab, pane, window = mux.spawn_window(cmd or {})
	window:gui_window():maximize()
end)

-- GPU
local gpus = wezterm.gui.enumerate_gpus()
config.webgpu_preferred_adapter = gpus[1]
config.front_end = "WebGpu"

-- Keymaps
local act = wezterm.action
config.disable_default_key_bindings = true
config.leader = { key = "`", timeout_milliseconds = 1000 }
config.keys = {
	-- Map Ctrl+Bspc to delete word
	{
		key = "Backspace",
		mods = "CTRL",
		action = act.SendKey({
			key = "w",
			mods = "CTRL",
		}),
	},
	-- Remap copy and paste [for halmak]
	{
		key = "c",
		mods = "CTRL",
		action = act({
			PasteFrom = "Clipboard",
		}),
	},
	{
		key = "v",
		mods = "CTRL",
		action = act({
			CopyTo = "Clipboard",
		}),
	},
	-- Tmux mappings
	-- Enable typing of leader key when pressed twice
	{
		key = "`",
		mods = "LEADER",
		action = act.SendKey({
			key = "`",
		}),
	},
	-- `c to create new tab
	{
		key = "c",
		mods = "LEADER",
		action = act({
			SpawnTab = "CurrentPaneDomain",
		}),
	},
	-- `q to close tab
	{
		key = "q",
		mods = "LEADER",
		action = act.CloseCurrentTab({ confirm = false }),
	},
	-- Shift+Left to move to left tab
	{
		key = "LeftArrow",
		mods = "SHIFT",
		action = act({
			ActivateTabRelative = -1,
		}),
	},
	-- Shift+Right to move to right tab
	{
		key = "RightArrow",
		mods = "SHIFT",
		action = act({
			ActivateTabRelative = 1,
		}),
	},
	-- Shift+Right to move to right tab
	{
		key = "d",
		mods = "LEADER",
		action = act.ShowDebugOverlay,
	},
}

-- Appearance
config.enable_tab_bar = true
config.use_fancy_tab_bar = false
config.window_background_opacity = 0.65
config.win32_system_backdrop = "Acrylic"
config.font = wezterm.font("CaskaydiaCove NFM")
config.font_size = 14
config.color_scheme = "Tokyo Night"
config.window_decorations = "RESIZE"

return config

Expected Behavior

It should open a new tab to my WSL home directory "~" which is also the directory that wezterm booted up to image

Logs

No response

Anything else?

No response

WTanardi avatar Aug 05 '24 09:08 WTanardi