Skip to content

fix(cli): handle non-printable characters in tag error display #166

@rocketman-code

Description

@rocketman-code

The null byte validation case in `validate_tag_name()` includes `got '{tag}'` in the error message. When `tag` contains a null byte, the rendered output may appear truncated or empty depending on the terminal:

```
error: invalid tag name: valid tags are printable text (e.g., `baseline`, `v1`), got ''
```

Consider either:

  1. Omitting the `got '{tag}'` clause for the null byte case (since the input is not meaningfully printable)
  2. Escaping or replacing non-printable characters in the display (e.g., show `\0` or ``)

This is an edge case (users rarely type null bytes), but the current behavior is confusing when it does occur.

Discovered during review of #164.

Metadata

Metadata

Assignees

No one assigned

    Labels

    uxUser experience improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions