mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 19:49:15 +08:00
1dac0041d5
The fix for #2075 inadvertently started unescaping the strings emitted from `commandline -b`. Only strings emitted with the `-o` flag are supposed to be unescaped. Fixes #2210.
31 lines
937 B
Plaintext
31 lines
937 B
Plaintext
# vim: set filetype=expect:
|
|
|
|
spawn $fish
|
|
|
|
expect_prompt
|
|
|
|
send_line "bind '~' 'handle_tilde'"
|
|
expect_prompt
|
|
|
|
# printing the current buffer should not remove quoting
|
|
send_line "function handle_tilde; echo; echo '@GUARD:1@'; commandline -b; echo '@/GUARD:1@'; commandline -b ''; end"
|
|
expect_prompt
|
|
send_line {echo \en one "two three" four'five six'{7} 'eight~}
|
|
expect_prompt -re {\r\n@GUARD:1@\r\n(.*)\r\n@/GUARD:1@\r\n} {
|
|
puts "a:"
|
|
puts $expect_out(1,string)
|
|
} unmatched {
|
|
abort "Couldn't find guard 1"
|
|
}
|
|
|
|
# printing the buffer with -o should remove quoting
|
|
send_line "function handle_tilde; echo; echo '@GUARD:2@'; commandline -bo; echo '@/GUARD:2@'; commandline -b ''; end"
|
|
expect_prompt
|
|
send_line {echo one "two three" four'five six'{7} 'eight~}
|
|
expect_prompt -re {\r\n@GUARD:2@\r\n(.*)\r\n@/GUARD:2@\r\n} {
|
|
puts "b:"
|
|
puts [string map {\r {}} $expect_out(1,string)]
|
|
} unmatched {
|
|
abort "Couldn't find guard 2"
|
|
}
|