mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Fix regression causing error and prompt corruption on paste
Closes #7782 [ci skip]
This commit is contained in:
parent
6bc0064a2a
commit
e450190d50
1 changed files with 8 additions and 2 deletions
|
@ -8,7 +8,9 @@ function __fish_tokenizer_state --description "Print the state of the tokenizer
|
|||
# - single-escaped - open \\ inside single-quotes
|
||||
# - double-escaped - open \\ inside double-quotes
|
||||
|
||||
argparse --min-args 1 --max-args 1 i/initial-state= -- $argv
|
||||
# Don't expect one arg only, as (commandline -ct) may evaluate to multiple arguments since
|
||||
# output is forcibly split on new lines (issue #7782).
|
||||
argparse --min-args 1 i/initial-state= -- $argv
|
||||
or return 1
|
||||
|
||||
set -l state normal
|
||||
|
@ -16,7 +18,11 @@ function __fish_tokenizer_state --description "Print the state of the tokenizer
|
|||
set str $_flag_initial_state
|
||||
end
|
||||
|
||||
for char in (string split -- "" $argv[1])
|
||||
# HACK: We care about quotes and don't care about new lines, joining multi-line arguments
|
||||
# produced by (commandline -ct) on anything other than \n will corrupt the contents but will
|
||||
# allow the following logic to work (including escape of subsequent character). This entire
|
||||
# function should probably be implemented as part of the `commandline` builtin.
|
||||
for char in (string split -- "" (string join -- \x1e $argv))
|
||||
switch $char
|
||||
case "'" # single-quote
|
||||
switch $state
|
||||
|
|
Loading…
Reference in a new issue