Skip to content

Copy and cut commands don't work on pwsh on WSL2 Ubuntu #1993

@fsackur

Description

@fsackur

Environment

PS version: 7.1.0
PSReadline version: 2.1.0
os: Linux L7P30N13 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
PS file version: 7.1.0.0
HostName: ConsoleHost
BufferWidth: 138
BufferHeight: 70

I am using Windows Terminal.

Steps to reproduce

  • Install WSL 2
  • Install Ubuntu
  • Install pwsh in WSL
  • Set up these handlers for windows-style Ctrl-C / Ctrl-X:
    Set-PSReadlineKeyHandler -Chord Ctrl+c -Function CopyOrCancelLine
    Set-PSReadlineKeyHandler -Chord Ctrl+x -Function Cut

Expected behavior

Select text. Ctrl-C or Ctrl-X should place that text on the system clipboard. It should be possible to paste that text in the same WSL terminal or anywhere in the Windows system.

Actual behavior

Text is not placed on the clipboard. Paste, even in the same console, is still pasting the previous clipboard contents.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions