Skip to content

Conversation

@Hona
Copy link
Collaborator

@Hona Hona commented Jan 18, 2026

What does this PR do?

Fixes #8166

copying text like

image

on windows would expand these variables because it uses powershell

changes to use stdin - the same as linux clipboard

I found a duplicate PR - however mine stays consistent with linux
#8150

How did you verify your code works?

copying the same text on latest release and my branch on windows

Copilot AI review requested due to automatic review settings January 18, 2026 21:48
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found 3 potentially related PRs that deal with Windows/WSL clipboard functionality:

  1. PR fix(tui): support clipboard image paste with proper filename on WSL2 #8209: fix(tui): support clipboard image paste with proper filename on WSL2

  2. PR fix(tui): fix Ctrl+V paste on Windows/WSL2 (#6560 and #8209) #8626: fix(tui): fix Ctrl+V paste on Windows/WSL2 (#6560 and #8209)

  3. PR feat: add input_copy and input_cut keybindings for keyboard-based text selection #7520: feat: add input_copy and input_cut keybindings for keyboard-based text selection

These PRs all touch the clipboard handling layer on Windows/WSL environments. You should verify if any address the same variable expansion issue or if they've already fixed this problem.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue on Windows where copying text containing PowerShell variables (like $env:FOO) would cause those variables to be evaluated/expanded due to PowerShell's string interpolation when passed as command-line arguments.

Changes:

  • Modified Windows clipboard implementation to use stdin instead of command-line arguments
  • Added explicit UTF-8 encoding configuration for PowerShell's input stream
  • Aligned Windows implementation pattern with existing Linux clipboard implementations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rekram1-node rekram1-node merged commit e81bb86 into anomalyco:dev Jan 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PowerShell] Certain special characters have still not been escaped

2 participants