Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.70] Escape % in bash and zsh shell integration #157352

Merged
merged 2 commits into from Aug 5, 2022

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Aug 5, 2022

Fixes #157226

@Tyriar Tyriar added the candidate Issue identified as probable candidate for fixing in the next release label Aug 5, 2022
@Tyriar Tyriar added this to the July 2022 Recovery milestone Aug 5, 2022
@Tyriar Tyriar requested a review from meganrogge August 5, 2022 23:44
@Tyriar Tyriar self-assigned this Aug 5, 2022
@Tyriar Tyriar enabled auto-merge August 5, 2022 23:53
@Tyriar Tyriar merged commit cad5890 into release/1.70 Aug 5, 2022
@Tyriar Tyriar deleted the tyriar/1_70_157226 branch August 5, 2022 23:56
@@ -59,7 +59,8 @@ __vsc_update_cwd() {

__vsc_command_output_start() {
builtin printf "\033]633;C\007"
builtin printf "\033]633;E;$__vsc_current_command\007"
# Send command line, escaping printf format chars %
builtin printf "\033]633;E;$(echo $__vsc_current_command | sed s/%/%%/g)\007"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to escape if $__vsc_current_command is passed as a separate parameter to printf, avoiding the need for the sub-shell and sed, like this:

builtin printf "\033]633;E;%s\007" "$__vsc_current_command"

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
candidate Issue identified as probable candidate for fixing in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants