Skip to content

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

Open
@OliveiraNt

Description

@OliveiraNt

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
            ));
        };
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions