Skip to content

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

Open
@RokeJulianLockhart

Description

@RokeJulianLockhart

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementIt's a feature request.Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions