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

Interpret control characters pasted into -LiteralPath arguments verbatim – do not replace them. #4447

Open
1 task done
RokeJulianLockhart opened this issue Feb 4, 2025 · 0 comments
Labels
Issue-Enhancement It's a feature request. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Feb 4, 2025

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

Tabs are valid in UNIX file paths. However, when pasted into PowerShell running as an interactive shell, they are converted into spaces, due to issues/144#event-1337497655. 1 This means that accessing paths with tabs inside them is impossible in an interactive shell, despite being possible in a .PS1 script.

I propose that inline tabs (those not prepended to a line's non-whitespace content) be retained, verbatim.

Proposed technical implementation details (optional)

Because issues/144#event-1337497655 solely cares about indentative tabs, retaining inline tabs wouldn't be problematic. Likewise, tabs prefixing a line do not impact this use case, because any path with a prefixed tab shall regardless be escaped (as '$Path').

However, PSReadLine currently pastes content by simulating typing. 2 #1471 (comment) requests that paste bracketing be implemented so that functionality like this can be implemented, which means that this FR depends upon its implementation.

Footnotes

  1. github.com/PowerShell/PowerShell/issues/24037#issuecomment-2225934625

  2. github.com/PowerShell/PowerShell/issues/24037#issuecomment-2634587883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement It's a feature request. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.
Projects
None yet
Development

No branches or pull requests

1 participant