Bracketed paste using INPUT_RECORD marks · Issue #20896 · PowerShell/PowerShell · GitHub
Skip to content

Bracketed paste using INPUT_RECORD marks #20896

Description

Summary of the new feature / enhancement

Since PowerShel reads the input stream using ReadConsoleInput, could you consider adding a support for "Bracketed Paste" marks in the INPUT_RECORD's stream. This could be done by handling boundary marks for the inserted block in the following form:

rec.EventType == MENU_EVENT;
rec.Event.MenuEvent.dwCommandId = 0x8001; // paste_begin

// set of recs with wchar-by-wchar copy
// of the block pasted from the clipboard
rec.EventType == KEY_EVENT;
rec.Event.KeyEvent.uChar.UnicodeChar = wchar; // Pasted data set

rec.EventType == MENU_EVENT;
rec.Event.MenuEvent.dwCommandId`= 0x8002; // paste_end

This approach greatly simplifies the task of cross-platform transferring an inserted immutable block via SSH between hosts. Both from unix to windows to unix, and from windows to unix to windows.

x-link microsoft/WSL#10905

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions