Skip to content

quitcd not working in fish if path contains backslash #1957

@Ordoviz

Description

@Ordoviz

If you press ^G to exit nnn or have configured quitcd, nnn writes a cd command in POSIX-shell syntax into ~/.config/nnn/.lastd. While fish syntax is similar to POSIX, they differ on their handling of backslashes in single-quoted strings. In particular, if nnn writes a path ending in a backslash into .lastd, and you source .lastd in fish you get Unexpected end of string, quotes are not balanced.

To fix this, nnn should write the raw (unescaped) path to ~/.config/nnn/.lastd_raw or stdout so that you don't need to parse the escaped path in fish. This would probably also be helpful for nushell, where you currently need to do some horrible string parsing to extract the path from .lastd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions