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

Issue:
zellij with empty session name will be blocked forever

**Basic information**

`zellij --version`: 0.33.0
`stty size`: 43 91
`uname -av` or `ver`(Windows): Linux zj16 6.0.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Nov 2022 21:14:24 +0000 x86_64 GNU/Linux

**Further information**

Simply run `zellij -s '' `, the zellij process will be blocked forever.

I think it should validate the session name and print an error message instead.



Discussion / hints:
@oraoto Good find! Thank you for reporting. I'll fix it ASAP.

Fix patch:
diff --git a/src/sessions.rs b/src/sessions.rs
index 420ed9d130..5a5c15d831 100644
--- a/src/sessions.rs
+++ b/src/sessions.rs
@@ -198,6 +198,11 @@ pub(crate) fn assert_session(name: &str) {
 }
 
 pub(crate) fn assert_session_ne(name: &str) {
+    if name.trim().is_empty() {
+        eprintln!("Session name cannot be empty. Please provide a specific session name.");
+        process::exit(1);
+    }
+
     match session_exists(name) {
         Ok(result) if !result => return,
         Ok(_) => println!("Session with name {:?} already exists. Use attach command to connect to it or specify a different name.", name),


Test patch: