You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
20241229_002511_89817757
Ask your question!
I hacked togerther a wezterm config, with diffrent oparts from diffrent config files, and i now got something i like. But im trying to set the tab title to the current working direcotry, and i can see each time i change directory the title flashes but then stays as zsh, i tried to add some debug to my code and i can see this output:
12:00:26.633 INFO logging > lua: Raw cwd: nil
12:00:26.633 INFO logging > lua: cwd is nil
>
12:00:30.637 INFO logging > lua: cwd is userdata, file_path: /home/mads/
12:00:31.356 INFO logging > lua: Raw cwd: file://pc073003/home/mads/
12:00:31.356 INFO logging > lua: tesxt: file://pc073003/home/mads/
12:00:31.356 INFO logging > lua: cwd is userdata, file_path: /home/mads/
12:00:31.639 INFO logging > lua: Raw cwd: file://pc073003/home/mads/
12:00:31.639 INFO logging > lua: tesxt: file://pc073003/home/mads/
12:00:31.639 INFO logging > lua: cwd is userdata, file_path: /home/mads/
12:00:31.932 INFO logging > lua: Raw cwd: nil
12:00:31.932 INFO logging > lua: cwd is nil
12:00:31.935 INFO logging > lua: Raw cwd: nil
12:00:31.935 INFO logging > lua: cwd is nil
12:00:32.640 INFO logging > lua: Raw cwd: nil
12:00:32.640 INFO logging > lua: cwd is nil
so it looks like it gets the folder, but its quicky resat to nil, why is that?
This is my complete config
wezterm.on("update-status", function(window, pane)
-- Workspace name
local stat = window:active_workspace()
local stat_color = "#f7768e"
-- It's a little silly to have workspace name all the time
-- Utilize this to display LDR or current key table name
if window:active_key_table() then
stat = window:active_key_table()
stat_color = "#7dcfff"
end
if window:leader_is_active() then
stat = "LDR"
stat_color = "#bb9af7"
end
local basename = function(s)
-- Nothing a little regex can't fix
return string.gsub(s, "(.*[/\\])(.*)", "%2")
end
-- Current working directory
local cwd = pane:get_current_working_dir()
wezterm.log_info("Raw cwd: " .. tostring(cwd))
if cwd then
wezterm.log_info("tesxt: " .. tostring(cwd))
if type(cwd) == "userdata" then
-- Log information about the URL object
wezterm.log_info("cwd is userdata, file_path: " .. tostring(cwd.file_path))
cwd = basename(cwd.file_path)
else
-- Log the raw cwd if it's not userdata
wezterm.log_info("cwd is string: " .. tostring(cwd))
cwd = basename(cwd)
end
else
wezterm.log_info("cwd is nil")
cwd = ""
end
-- Current command
local cmd = pane:get_foreground_process_name()
cmd = cmd and basename(cmd) or ""
i hope someone can point my in the right direction, as its the last thing i need.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What Operating System(s) are you running on?
Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
20241229_002511_89817757
Ask your question!
I hacked togerther a wezterm config, with diffrent oparts from diffrent config files, and i now got something i like. But im trying to set the tab title to the current working direcotry, and i can see each time i change directory the title flashes but then stays as zsh, i tried to add some debug to my code and i can see this output:
so it looks like it gets the folder, but its quicky resat to nil, why is that?
This is my complete config
i hope someone can point my in the right direction, as its the last thing i need.
Beta Was this translation helpful? Give feedback.
All reactions