Linux – On wsl1, getting clipboard contents using powerhshell changes terminal appearance…

clipboardpowershellterminalwindows-subsystem-for-linux

I posted this on stack (now deleted), but was told that this might be a more appropriate forum.

I'm on windows-subsystem-linux 1 with Ubuntu with the Windows Ubuntu terminal.

Using advice from this post: https://stackoverflow.com/questions/17819814/how-can-you-get-the-clipboard-contents-with-a-windows-command

I'm calling powershell to output the contents of the clipboard to a file, as in:

powershell.exe -command "Get-Clipboard" > myFile.txt

This completely changes the appearance of my terminal and I think I might be running powershell, or something. See "before" and "after redirecting to a file", below. It also truncates my terminal after about ~3/4 of the screen.

You'll note that the window description now says "powershell.exe". But I can still run linux commands, and I have access to functions and aliases defined in my bashrc, so it's not like I'm suddenly in a powershell environment.

What's odd is that if I run, powershell.exe -command "Get-Clipboard" (ie without redirecting) it outputs the clipboard contents to the terminal without affecting my terminal appearance.

Typing ctrl-c does nothing. ctrl-d or typing exit just kills the terminal.

Any ideas about what's going on?

Before:

After redirecting to the terminal:

After redirecting to a file: