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

Missing semi-colon in Bash's "new tab, same directory" example #819

Closed
ethanherbertson opened this issue Dec 16, 2024 · 1 comment
Closed
Assignees

Comments

@ethanherbertson
Copy link

Type of issue

Code doesn't work

Feedback

The example here: https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory#bash

is missing a semi-colon in it's "bash magic". Currently you've got

PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"'

With the intention that if PROMPT_COMMAND is already set, of merely appending to it rather than wiping-out what was already there. However, as written above, there's no semi-colon separating the previous command(s) from the new printf one, leading to unexpected behavior.

I believe it should instead read like this:

PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND ; "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"'

Page URL

https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory

Content source URL

https://github.com/MicrosoftDocs/terminal/blob/main/TerminalDocs/tutorials/new-tab-same-directory.md

Author

@zadjii-msft

Document Id

439baddf-3ec9-a46e-1b6e-3ec47cbd1d4c

@nguyen-dows
Copy link
Collaborator

Thanks for the catch, @ethanherbertson! I added the missing semi-colon and closed the issue! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants