Open dominz88 opened 1 year ago
The error message you shared indicates that you've asked wezterm to spawn something in the local domain.
Can you reproduce this without using gnome hotkeys? Most likely, gnome is running this command from the .desktop file:
What wezterm processes are running in between closing and re-opening?
Can you reproduce this without using gnome hotkeys?
The problem doesn't appear if i simply run:wezterm connect sysadmin
.
Most likely, gnome is running this command from the .desktop file:
That's indeed the case
What wezterm processes are running in between closing and re-opening?
In my local machine, none. On the remote /usr/bin/wezterm-mux-server --pid-file-fd
So did you try running wezterm start --cwd .
like gnome would?
Oh! I apologize, I should've done that. Indeed, that reproduces the problem.
wezterm start --cwd .
wezterm start --cwd .
gives the error:
Process "/bin/zsh" in domain "local" didn't exit cleanly
Exited with code 1.
This message is shown because exit_behavior="CloseOnCleanExit"No such file or directory (os error 2)
There are no wezterm processes left after i close the tab. So, closing the only/last tab, closes the window and ends the process /usr/bin/wezterm-gui start --cwd .
By the way, thanks for your time and help.
I can't reproduce this.
Here's what I tried:
Put this into /tmp/4161.lua
:
local wezterm = require 'wezterm'
local config = {}
config.default_domain = 'sysadmin'
config.ssh_domains = {
{
name = 'sysadmin',
remote_address = 'foo',
},
}
return config
Then ensure that no wezterm processes are running.
Then run wezterm --config-file /tmp/4161.lua start --cwd .
Then try close the tab (either via CTRL-D or by clicking the close button on the tab).
Then run wezterm --config-file /tmp/4161.lua start --cwd .
again.
These steps work as I expect; closing the tab means that the next time I connect a new tab is created. If instead I close the window, reconnecting shows me the tab that I left behind.
Is there something else about your setup that isn't reflected in these steps?
Then run
wezterm --config-file /tmp/4161.lua start --cwd .
Then try close the tab (either via CTRL-D or by clicking the close button on the tab). Then runwezterm --config-file /tmp/4161.lua start --cwd .
again.
Yes, thats all there is to it, i've tried using de ubuntu 22 deb package and the appimage. With the same result
I did some more tests:
It seems that what ever is going on, it is happening on the wezterm server side. Because:
In other words, if I do the following I still get the error:
wezterm start --cwd .
on my ubuntu clientwezterm start --cwd .
on my mac client I see that the process wezterm-mux-server --pid-file-fd 9
is still running, even after closing the only tab left via any client.
I tested the same steps using a fedora vm as ssh domain and still get the same error.
Ok after many tests it seems that the problem comes from the parameter "--cwd ." The manual says
--cwd <CWD>
Specify the current working directory for the initially spawned program
Weirdly enough, it works just fine if my local user and my remote user are the same or is it because the working directory is the same on both sides ( /home/myuser) ?
The thing that needs to be resolved and understood is why the local
domain is being used at all in your configuration.
The cwd parameter itself is not the problem; it's that something is using the local
domain for you for some reason.
Try turning up the debugging level:
WEZTERM_LOG=trace wezterm start --cwd . >/tmp/verbose.log 2>&1
this will be very verbose. Please share that resulting log file with me.
Hello,
Here is the log file generated during the error, I don't see in it any message related to the problem though.
According to this part of the log:
16:13:12.208 INFO wezterm_gui > Spawned your command via the existing GUI instance. Use wezterm start --always-new-process if you do not want this behavior. Result=SpawnResponse { tab_id: 2, pane_id: 2, window_id: 1, size: TerminalSize { rows: 24, cols: 80, pixel_width: 640, pixel_height: 384, dpi: 0 } }
you already have a running wezterm instance, and that is being used to satisfy the request. Please include verbose logging from that instance as well!
Hello,
luis@PC-LUIS ~ WEZTERM_LOG=trace wezterm --config-file wez start --cwd . >/tmp/verbose.log 2>&1
luis@PC-LUIS ~ ps awufx | grep wezterm
luis 10927 0.0 0.0 17888 2688 pts/1 S+ 21:15 0:00 | \_ grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox wezterm
luis@PC-LUIS ~ WEZTERM_LOG=trace wezterm --config-file wez start --cwd . >/tmp/verbose.log 2>&1
I reproduced the same problem ensuring there is no instance left between runs. Here are the traces
verbose.log.1.txt verbose.log.2.txt
I also noticed that if i stop the wezterm server between relaunches on my ssh domain the error is not present. Is there a way to enable the debug on the server side ?
What Operating System(s) are you seeing this problem on?
Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
Gnome-shell
WezTerm version
20230712-072601-f4abf8fd
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
Hello,
I encounter this weird error while using hotkeys on gnome. In gnome (at least in ubuntu), you can open/toggle an application that is in the dock using Win+N (where N is the position of the app in the dock).
My goal is to always connect to my default ssh domain when starting wezterm and open/toggle wezterm while using a hotkey. This is to emulate the behavior of a drop-down-terminal (like Guake) + tmux over ssh for persistent shells on my remote machine.
It works fine in general, but if I close the last remaining tab manually or with Ctrl-D, I get the message bellow when opening westerm and i'm forced to open a new tab and then close the tab that contains de error message.
Thanks for your help
To Reproduce
Configuration
Expected Behavior
Instead of showing a tab with an error simply open a working tab.
Logs
No response
Anything else?
No response