Fish history format
#9514
-
I'd like to give fish another try, but I want to import my existing shell history (from ZSH). I found a script, but it doesn't work very well because I don't have the timestamps (and it doesn't escape the output anyway), so I wanted to rewrite or update it. fish uses something similar to, but not quite YAML (see also #4675), so I'm not sure what to output. It appears to |
Beta Was this translation helpful? Give feedback.
Answered by
krobelus
Jan 29, 2023
Replies: 1 comment
-
only two characters are escaped: // Support for escaping and unescaping the nonstandard "yaml" format introduced in fish 2.0.
static void escape_yaml_fish_2_0(std::string *str) {
replace_all(str, "\\", "\\\\"); // replace one backslash with two
replace_all(str, "\n", "\\n"); // replace newline with backslash + literal n
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lnicola
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
only two characters are escaped: