Skip to content

Fish history format #9514

Closed Answered by krobelus
lnicola asked this question in Q&A
Discussion options

You must be logged in to vote

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
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lnicola
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants