Open andychu opened 5 years ago
A few people mentioned here that they don't like that history is expanded within double quotes like "!!"
, which I agree with. If we do it as part of the parser it would fix that problem.
https://lobste.rs/s/l2fk5f/seven_god_like_bash_history_shortcuts_you
Also relevant to history:
zsh has hist_verify, which shows the result of history replacements/substitutions, and makes you hit enter again before execution. Seems like a nice middle ground between “blind” and TUI.
This isn't the way bash does it, but #451 made me think that this might be a good idea. (We copied bash's strategy of doing an entirely separate preprocessing/lexing phase.)
And I think it's pretty easily possible.
Comments aren't purely lexical because of
echo x#notcomment
andecho 'x'#notcomment
, etc.notes: in bash, history is expanded in double quotes, NOT in single quotes, and NOT in comments.
We can easily implement that rule. (Although honestly I don't see a use case for it being expanded in double quotes...)