Repository: zellij-org/zellij (language: rust)

Issue:
Thread 'pty' panicked: Cannot find shell zsh
Please attach the files that were created in `/tmp/zellij-1000/zellij-log/` to the extent you are comfortable with.
```
INFO   |zellij_client            | 2022-12-10 03:13:45.446 [main      ] [zellij-client/src/lib.rs:140]: Starting Zellij client! 
INFO   |zellij_server            | 2022-12-10 03:13:45.447 [main      ] [zellij-server/src/lib.rs:213]: Starting Zellij server! 
INFO   |zellij_server::plugins   | 2022-12-10 03:13:45.499 [wasm      ] [zellij-server/src/plugins/mod.rs:61]: Wasm main thread starts 
INFO   |zellij_client::input_hand| 2022-12-10 03:13:45.499 [input_handler] [zellij-client/src/input_handler.rs:151]: sending done loading 
INFO   |zellij_client::input_hand| 2022-12-10 03:13:45.499 [input_handler] [zellij-client/src/input_handler.rs:155]: done sent done loading 
INFO   |zellij_utils::input::plug| 2022-12-10 03:13:45.500 [wasm      ] [zellij-utils/src/input/plugins.rs:139]: Plugin 'compact-bar.wasm' exists in the 'PLUGIN DIR' at '/home/ndavd/.local/share/zellij/plugins/' but is being ignored 
ERROR  |zellij_utils::errors::not| 2022-12-10 03:13:45.503 [pty       ] [zellij-utils/src/errors.rs:545]: Panic occured:
             thread: pty
             location: At zellij-server/src/pty.rs:452:13
             message: Cannot find shell zsh 
INFO   |zellij_server::plugins   | 2022-12-10 03:13:45.503 [wasm      ] [zellij-server/src/plugins/mod.rs:123]: wasm main thread exits 
INFO   |zellij_client::input_hand| 2022-12-10 03:13:46.000 [input_handler] [zellij-client/src/input_handler.rs:158]: sending done loading 
INFO   |zellij_client::input_hand| 2022-12-10 03:13:46.000 [input_handler] [zellij-client/src/input_handler.rs:162]: done sent done loading 
```

**Basic information**

*zellij --version*: `zellij 0.34.3`
*stty size*: `26 106`
*OS*: `Arch Linux 6.0.11-arch1-1`

**Further information**
Issue occurs just by running `zellij`. It's fixed by running `zellij options --default-shell zsh`.

![image](https://user-images.githubusercontent.com/74260683/206826718-3526857d-fb89-4e1c-8e08-a91b8db8dfd8.png)



Discussion / hints:
Thanks for opening the issue @ndavd !

@har7an - this happens because of https://github.com/zellij-org/zellij/blame/main/zellij-server/src/pty.rs#L451 - I seem to remember there was a discussion about this, but I can't find where. What's the harm in just removing this section? If we don't find the shell, we'll error with a `Command not Found` when opening the pane and display it to the user. Clearly the `exists` here is not doing the right thing...
@imsnif Upon inspecting that piece of code you shared I noticed that the reason why this is happening is because it would need to take the absolute path of the shell. My `$SHELL` equals `zsh`, when checking if a path from that exists it will return false. Now, we could just check it and set it to the fallback `/bin/sh` instead.. But it's not only my system that does this, a far better solution would be to perhaps use the `which` command to get the full path of the `$SHELL` output and return that instead.

Fix patch:
diff --git a/zellij-server/src/pty.rs b/zellij-server/src/pty.rs
index e81ef5b268..9f4cd3e35c 100644
--- a/zellij-server/src/pty.rs
+++ b/zellij-server/src/pty.rs
@@ -448,9 +448,6 @@ impl Pty {
             log::warn!("Cannot read SHELL env, falling back to use /bin/sh");
             "/bin/sh".to_string()
         }));
-        if !shell.exists() {
-            panic!("Cannot find shell {}", shell.display());
-        }
         TerminalAction::RunCommand(RunCommand {
             args: vec![],
             command: shell,


Test patch: