-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SHELL=sh zellij is broken #1943
Comments
You're right, the lookup is wrong in this case. Is this something we actively supported previously, or was it more of a side-effect of the implementation? Because afaik, |
I was happy that I could use it.
|
Lol, good one. Fair point, I'll reenable it. A bit of |
If I may intervene - why not remove the |
Because starting zellij with a shell that doesn't exist (and for that matter it's irrelevant whether its specified in the config.kdl or in $SHELL) causes a freeze and makes zellij unresponsive to any input. This is not an issue on a local connection, because I just kill the terminal but I've had this happen via SSH on a remote machine in university yesterday. That's annoying to "fix". Although now that you mention it, I guess this needs a fix in another location where we catch both cases, right? I assume that #1769 touched a different codepath than what a shell defined in |
It seem there is a handling code for the command couldn't found. I don't know why does zellij cause the freeze. |
I see - makes sense. We have a bit of logic in place to look for the shell and similar commands when we spawn them. I wouldn't advise pre-checking with the same logic, but rather riding on that error. We in face already do this and have a special error for this case: zellij/zellij-server/src/pty.rs Line 129 in 4aae81f
I guess it doesn't help in this case because the screen thread never tells the client to unblock. I'm not sure there's a trivial fix for this. |
I think it'd be a good idea to rewrite |
That might be problematic, because in some cases it is constructed in an environment that is not guaranteed to be the same environment in which it will be run (eg. sending a cli command). |
How so? I mean how would this influence the sanity checks? Can the CWD be relative? |
Yes, the CWD can be relative. When we start doing more involved things with client/server (eg. web clients, sharing backends between machines, etc.) it will also be dangerous to assume in the code that it's running on the same machine. This error, in the context of Zellij starting, trickles down to here eventually: zellij/zellij-server/src/pty.rs Line 638 in 4aae81f
I think we even send it back to the screen (just weeding out the error). I think the "right" solution would be to handle it there. It's just a bit of work. |
On the upside though, if we handle it in screen we can directly display it to the user in the terminal pane rather than crashing. |
Right, good point.
But do all of them end up there? I'm not familiar with this bit of the code. Displaying an error in the pane when the shell couldn't be found and unblocking the input handling sounds like a reasonable thing to do. In this case the user can also quit the application regularly, which helps in SSH sessions. In fact, not entirely sure how displaying text in panes is handled, we already have the mechanisms in place to get a "stringified" version of all |
We already do this here: zellij/zellij-server/src/pty.rs Line 143 in 4aae81f
The problem is that here we do this with What happens here is (in a simplified way):
This error happens at the end of 2, is ignored and its id is sent to the screen (I think - gotta test it to be sure). To fix this we'll have to add a facility in screen to handle this case (namely, not weed out the error and look for it in the screen and then do the right thing with it). |
This worked previously:
SHELL=sh zellij
and zellij would start up with the specified shell.
Since #1769 this results in:
The text was updated successfully, but these errors were encountered: