Interpret control characters pasted into -LiteralPath
arguments verbatim – do not replace them.
#4447
Labels
Issue-Enhancement
It's a feature request.
Needs-Triage 🔍
It's a new issue that core contributor team needs to triage.
Prerequisites
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
github.com/PowerShell/PowerShell/issues/24037#issuecomment-2225934625
↩github.com/PowerShell/PowerShell/issues/24037#issuecomment-2634587883
↩The text was updated successfully, but these errors were encountered: