Skip to content

Validation error message for session name shows incorrect character limit #4211

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

Open
OliveiraNt opened this issue May 26, 2025 · 0 comments · May be fixed by #4217
Open

Validation error message for session name shows incorrect character limit #4211

OliveiraNt opened this issue May 26, 2025 · 0 comments · May be fixed by #4217

Comments

@OliveiraNt
Copy link

OliveiraNt commented May 26, 2025

When trying to start a session with a name that is too long, Zellij returns the following error message:

session name must be less than 0 characters

This message is confusing and incorrect. It happens when the session name causes the resulting socket path to exceed the maximum allowed length, but the displayed number of allowed characters ends up being zero.

"session name must be less than {} characters",

 if socket_path.as_os_str().len() >= ZELLIJ_SOCK_MAX_LENGTH {
            // socket path must be less than 108 bytes
            let available_length = ZELLIJ_SOCK_MAX_LENGTH
                .saturating_sub(socket_path.as_os_str().len())
                .saturating_sub(1);

            return Err(format!(
                "session name must be less than {} characters",
                available_length
            ));
        };
    };
@j-g00da j-g00da linked a pull request May 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant