wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Using wezterm nightly + PowerShell 5.1 with window_background_opacity < 1.0 results in broken transparency

Open 0x00A opened this issue 7 months ago • 3 comments

What Operating System(s) are you seeing this problem on?

Windows 10 22H2 19045.5737

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20250518-060218-5663e749

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Before updating to the nightly version I was using version 20240203-110809-5046fc22 and everything worked as expected, however after updating I noticed that whitespace breaks transparency, I think I was able to narrow it down to some issue with the nightly version and powershell as the transparency works as expected when powershell is not used.

To Reproduce

Here are four terminal recordings of simply pressing the spacebar, old refers to the version 20240203-110809-5046fc22 and new refers to the version 20250518-060218-5663e749

old_cmd (works as expected)

{"version":2,"width":80,"height":24,"timestamp":1747846562,"env":{"WEZTERM_TARGET_TRIPLE":"x86_64-pc-windows-msvc","TERM":"xterm-256color","WEZTERM_VERSION":"20240203-110809-5046fc22"},"theme":{"fg":"#b2b2b2","bg":"#000000","palette":"#000000:#cc5555:#55cc55:#cdcd55:#5455cb:#cc55cc:#7acaca:#cccccc:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"}}
[0.005547,"o","\u001b[?9001h\u001b[?1004h"]
[0.0287977,"o","\u001b[?25l\u001b[2J\u001b[m\u001b[HMicrosoft Windows [Version 10.0.19045.5854]\r\n(c) Microsoft Corporation. All rights reserved.\u001b[4;1HC:\\Users\\redacted>\u001b]0;C:\\WINDOWS\\system32\\cmd.exe\u0007\u001b[?25h"]
[2.5439606,"o"," "]
[7.5011587,"o","\u001b[?25l\u001b[6;1HC:\\Users\\redacted>\u001b[?25h"]
[8.374481,"o","e"]
[8.435921,"o","x"]
[8.514549,"o","i"]
[8.621832,"o","t"]

old_powershell (works as expected)

{"version":2,"width":80,"height":24,"timestamp":1747846694,"env":{"WEZTERM_TARGET_TRIPLE":"x86_64-pc-windows-msvc","WEZTERM_VERSION":"20240203-110809-5046fc22","TERM":"xterm-256color"},"theme":{"fg":"#b2b2b2","bg":"#000000","palette":"#000000:#cc5555:#55cc55:#cdcd55:#5455cb:#cc55cc:#7acaca:#cccccc:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"}}
[0.0051197,"o","\u001b[?9001h\u001b[?1004h"]
[0.6302617,"o","\u001b[?25l\u001b[2J\u001b[m\u001b[36m\u001b[1m\u001b[2;1H~\u001b[m\u001b[32m\u001b[1m\r\n❯\u001b[m\u001b[1C\u001b]0;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.EXE\u0007\u001b[?25h"]
[1.8062906,"o"," "]
[4.157678,"o","\b \u001b[91m^C\r\n"]
[4.1731744,"o","\u001b[m\u001b[36m\u001b[1m\r\n~\u001b[m \u001b[32m\u001b[1m\r\n❯\u001b[m "]
[4.903533,"o","\u001b[93me"]
[4.919502,"o","\u001b[m"]
[4.966379,"o","\u001b[93m\bex"]
[4.981403,"o","\u001b[m"]
[5.089188,"o","\u001b[?25l\u001b[93m\u001b[6;3Hexi\u001b[?25h"]
[5.1052585,"o","\u001b[m"]
[5.1515355,"o","\u001b[?25l\u001b[92m\u001b[6;3Hexit\u001b[?25h"]
[5.1672287,"o","\u001b[m"]
[5.38102,"o","\r\n"]

new_cmd (works as expected)

{"version":2,"width":80,"height":24,"timestamp":1747846942,"env":{"TERM":"xterm-256color","WEZTERM_VERSION":"20250518-060218-5663e749","WEZTERM_TARGET_TRIPLE":"x86_64-pc-windows-msvc"},"theme":{"fg":"#b2b2b2","bg":"#000000","palette":"#000000:#cc5555:#55cc55:#cdcd55:#5455cb:#cc55cc:#7acaca:#cccccc:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"}}
[0.0038504,"o","\u001b[1t"]
[0.0039309,"o","\u001b[6n\u001b[c\u001b[?1004h\u001b[?9001h"]
[0.0115213,"o","\u001b[3;1H"]
[0.0135817,"o","\u001b[?7l"]
[0.0136271,"o","\u001b[?7h"]
[0.0164851,"o","Microsoft Windows [Version 10.0.19045.5854]"]
[0.0165231,"o","\r\n"]
[0.0165643,"o","(c) Microsoft Corporation. All rights reserved."]
[0.016599,"o","\r\n"]
[0.0166797,"o","\r\n"]
[0.0167227,"o","C:\\Users\\redacted>"]
[0.883047,"o","\u001b[6;16H \u001b[6;17H"]
[2.0595715,"o","\r\n"]
[2.0596333,"o","\r\n"]
[2.0596702,"o","C:\\Users\\redacted>"]
[2.6358044,"o","\u001b[8;16He\u001b[8;17H"]
[2.6934917,"o","\u001b[8;17Hx\u001b[8;18H"]
[2.8248801,"o","\u001b[8;18Hi\u001b[8;19H"]
[2.898207,"o","\u001b[8;19Ht\u001b[8;20H"]
[3.242052,"o","\u001b[8;20H"]
[3.2420857,"o","\r\n"]
[3.2423816,"o","\u001b]0;C:\\WINDOWS\\system32\\cmd.exe - exit\u001b\\"]
[3.2424433,"o","\u001b]0;C:\\WINDOWS\\system32\\cmd.exe\u001b\\"]

new_powershell (transparency issues)

{"version":2,"width":80,"height":24,"timestamp":1747847092,"env":{"WEZTERM_VERSION":"20250518-060218-5663e749","WEZTERM_TARGET_TRIPLE":"x86_64-pc-windows-msvc","TERM":"xterm-256color"},"theme":{"fg":"#b2b2b2","bg":"#000000","palette":"#000000:#cc5555:#55cc55:#cdcd55:#5455cb:#cc55cc:#7acaca:#cccccc:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"}}
[0.0034139,"o","\u001b[1t"]
[0.0035213,"o","\u001b[6n\u001b[c\u001b[?1004h\u001b[?9001h"]
[0.0148716,"o","\u001b[4;1H"]
[0.59651536,"o","\r\n\u001b[1;36m~\u001b[0m \r\n\u001b[1;32m❯\u001b[0m "]
[1.2806163,"o","\u001b[?25l"]
[1.2806678,"o","\u001b[6;3H"]
[1.2807448,"o","\u001b[37m\u001b[40m "]
[1.2807691,"o","\u001b[37m\u001b[40m"]
[1.280791,"o","\u001b[0m"]
[1.2808607,"o","\u001b[6;4H"]
[1.280897,"o","\u001b[?25h"]
[3.413402,"o","\u001b[?25l"]
[3.4135444,"o","\u001b[6;3H"]
[3.4135835,"o","\u001b[37m\u001b[40m "]
[3.4136128,"o","\u001b[37m\u001b[40m"]
[3.4136364,"o","\u001b[0m"]
[3.4136994,"o","\u001b[6;4H"]
[3.413731,"o","\u001b[?25h"]
[3.4137561,"o","\u001b[91m^C\u001b[0m"]
[3.4139895,"o","\r\n"]
[3.4474,"o","\r\n\u001b[1;36m~\u001b[0m \r\n\u001b[1;32m❯\u001b[0m "]
[4.1703486,"o","\u001b[?25l"]
[4.1704426,"o","\u001b[9;3H"]
[4.1705136,"o","\u001b[93me"]
[4.1705394,"o","\u001b[37m\u001b[40m"]
[4.1705647,"o","\u001b[0m"]
[4.1706266,"o","\u001b[9;4H"]
[4.1706915,"o","\u001b[?25h"]
[4.213001,"o","\u001b[?25l"]
[4.2131624,"o","\u001b[9;3H"]
[4.213226,"o","\u001b[93mex"]
[4.213341,"o","\u001b[37m\u001b[40m"]
[4.213447,"o","\u001b[0m"]
[4.213573,"o","\u001b[9;5H"]
[4.2136283,"o","\u001b[?25h"]
[4.3137035,"o","\u001b[?25l"]
[4.3137717,"o","\u001b[9;3H"]
[4.3138976,"o","\u001b[93mexi"]
[4.3139443,"o","\u001b[37m\u001b[40m"]
[4.3140364,"o","\u001b[0m"]
[4.31411,"o","\u001b[9;6H"]
[4.3141756,"o","\u001b[?25h"]
[4.414684,"o","\u001b[?25l"]
[4.414717,"o","\u001b[9;3H"]
[4.4147873,"o","\u001b[92mexit"]
[4.414814,"o","\u001b[37m\u001b[40m\u001b[0m"]
[4.414901,"o","\u001b[9;7H"]
[4.4149246,"o","\u001b[?25h"]
[4.7460775,"o","\u001b[10;1H"]

Configuration

The examples that use powershell the config is as follows:

local wezterm = require 'wezterm'
local config = wezterm.config_builder()

config.default_prog = { "powershell", "-nologo" }
config.window_background_opacity = 0.8

return config

Otherwise the config is as follows:

local wezterm = require 'wezterm'
local config = wezterm.config_builder()

config.window_background_opacity = 0.8

return config

Expected Behavior

I expect the transparency to work as in the older version.

Logs

old

wezterm version: 20240203-110809-5046fc22 x86_64-pc-windows-msvc
Window Environment: Windows
Lua Version: Lua 5.4
OpenGL: NVIDIA GeForce RTX 3080/PCIe/SSE2 4.5.0 NVIDIA 566.14

new

wezterm version: 20250518-060218-5663e749 x86_64-pc-windows-msvc
Window Environment: Windows
Lua Version: Lua 5.4
OpenGL: NVIDIA GeForce RTX 3080/PCIe/SSE2 4.5.0 NVIDIA 566.14

Anything else?

Image

0x00A avatar May 21 '25 17:05 0x00A

I was unable to reproduce. Windows 11: 26200.5622 WezTerm: 20250604-060157-5106c8c1 PowerShell: 7.5.1

Image

hboyd2003 avatar Jun 09 '25 05:06 hboyd2003

Indeed, after manually installing and switching WezTerm to use PowerShell 7.5.1 the issue is no longer present.

The version that is automatically installed on Windows 10 for me is PowerShell 5.1.19041.5848.

I'm not sure whether the issue should be closed, as it does require manually switching to the PowerShell 7.x, which is not the default for Windows 10. I'll leave that decision to the maintainers.

If anyone else stumbles upon this issue, here's what I did to fix it on my end:

Install PowerShell 7:

winget install --id Microsoft.PowerShell --source winget

Update your WezTerm config:

-config.default_prog = { "powershell", "-nologo" }
+config.default_prog = { "pwsh", "-nologo" }

0x00A avatar Jun 09 '25 06:06 0x00A

Microsoft is unlikely to ever ship Windows with anything past PowerShell 5 since its been 7 years since PowerShell 6 was released (and 13 since the control panel replacement was released). In any case even with 5.1.26100.5603 (versions are tied to windows version) I was unable to reproduce. Maybe it is an issue with Windows 10?

hboyd2003 avatar Jun 09 '25 07:06 hboyd2003