Skip to content
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

Process escape character sequences properly in config KDL #3396

Open
samholmes opened this issue Jun 4, 2024 · 0 comments
Open

Process escape character sequences properly in config KDL #3396

samholmes opened this issue Jun 4, 2024 · 0 comments

Comments

@samholmes
Copy link

I have this in my config:

    normal clear-defaults=true {
        bind "\u0000" { SwitchToMode "tab"; }
    }

I'm trying to bind the "\x00" character to switch to "tab" mode. But when running Zellij I get:

  × Failed to parse Zellij configuration
   ╭─[/Users/samholmes/.config/zellij/config.kdl:2:1]
 2 │     normal clear-defaults=true {
 3 │         bind "\u0000" { SwitchToMode "tab"; }
   ·                ▲
   ·                ╰── Kdl Deserialization Error
 4 │     }
   ╰────
  help: For more information, please see our configuration guide: https://zellij.dev/documentation/
        configuration.html

I'm running Zellij 0.40.1.

My old YAML file contained:

keybinds:
  normal:
    - unbind: true
    # Switch Modes (only one switch)
    - action: [SwitchToMode: Tab]
      key: [Char: "\x00"]
    # - action: [SwitchToMode: Locked]
    #   key: [Esc]

Which can compile to KDL, but it causes my KDL file to contain the character "�" in my file (which is the escaped character), which causes my KDL file to be mis-interpretted as a binary file instead of a text file.

The fix for this would mean that whatever KDL parser that Zellij is using must respect escape sequences like "\x00" or "\u0000".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant