Skip to content

Password Input: disable copy and update Ctrl+Backspace behavior #2669

Description

@mek-yt

I created a small Pinentry UI using gpui-component and noticed that the masked input is missing some key security features.

I would like to tighten up the password input behavior:

  • Security: Prevent "Copy" actions (both context menu and keyboard shortcuts) to stop passwords from entering the system clipboard when masked.
  • UX: Override default Ctrl+Backspace behavior. Instead of deleting the previous word, it should clear the entire input value before cursor when masked.

Steps to Reproduce:

  • Enter text into the Password Input.
  • Try to copy the text using the context menu or keyboard shortcuts → Current: Text is copied.
  • Place the cursor in the middle of the password and press Ctrl+Backspace → Current: Only a portion of the password is deleted.

I am happy to submit a PR for this if it's acceptable.

Architectural Question:

Should I:

  • update the behavior of the existing Input component when mask_toggle is active
  • create new behavior flags for the existing Input component
  • propose a separate PasswordInput component to keep the general Input logic clean?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions