Text user interface looks distorted when run from PowerShell or Cmd #16806

Closed
opened 2026-01-31 05:23:34 +00:00 by claunia · 6 comments
Owner

Originally created by @thorstenkampe on GitHub (Feb 17, 2022).

Windows Terminal version

1.12.220208003-release1.12

Windows build number

10.0.22000.0

Other Software

Python 3.10.2
npyscreen 4.10.5

Steps to reproduce

Run the following code to create a simple text user interface with Npyscreen from PowerShell or cmd:

import sys
from npyscreen import *

class DbApp(NPSAppManaged):
    def onStart(self):
        self.registerForm('MAIN', DbParams())

class DbParams(ActionForm):
    def create(self):
        self.host   = self.add(TitleText, name='- Host:')
        self.port   = self.add(TitleText, name='- Port:')
        self.db     = self.add(TitleText, name='- Database:')
        self.user   = self.add(TitleText, name='- User:')
        self.passwd = self.add(TitlePassword, name='- Password:')

    def on_cancel(self):
        sys.exit()

DbApp().run()

Expected Behavior

This is how it should look like - and actually does in Windows Terminal if I run the code from Cygwin bash (also looks fine in ConEmu or Conhost):
image

Actual Behavior

This is how it looks like when run from Windows PowerShell or Cmd:
image

Originally created by @thorstenkampe on GitHub (Feb 17, 2022). ### Windows Terminal version 1.12.220208003-release1.12 ### Windows build number 10.0.22000.0 ### Other Software Python 3.10.2 npyscreen 4.10.5 ### Steps to reproduce Run the following code to create a simple text user interface with Npyscreen from PowerShell or cmd: ```python import sys from npyscreen import * class DbApp(NPSAppManaged): def onStart(self): self.registerForm('MAIN', DbParams()) class DbParams(ActionForm): def create(self): self.host = self.add(TitleText, name='- Host:') self.port = self.add(TitleText, name='- Port:') self.db = self.add(TitleText, name='- Database:') self.user = self.add(TitleText, name='- User:') self.passwd = self.add(TitlePassword, name='- Password:') def on_cancel(self): sys.exit() DbApp().run() ``` ### Expected Behavior This is how it should look like - and actually does in Windows Terminal if I run the code from Cygwin bash (also looks fine in ConEmu or Conhost): ![image](https://user-images.githubusercontent.com/475462/154568875-eaeabb57-abab-4bde-b592-3f3159d083ac.png) ### Actual Behavior This is how it looks like when run from Windows PowerShell or Cmd: ![image](https://user-images.githubusercontent.com/475462/154569045-31011365-e1f2-4f1e-acf9-e48358de0696.png)
claunia added the Needs-TriageIssue-BugResolution-ExternalNeeds-Tag-Fix labels 2026-01-31 05:23:35 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 17, 2022):

This looks to me like a bug that should be filed upstream. I suspect whatever library you're using is detecting it's running on Windows and just not doing the right thing. It's probably not setting the right console flags.

However, https://github.com/npcole/npyscreen does look fairly abandoned...

@zadjii-msft commented on GitHub (Feb 17, 2022): This looks to me like a bug that should be filed upstream. I suspect whatever library you're using is detecting it's running on Windows and just not doing the right thing. It's probably not setting the right console flags. However, https://github.com/npcole/npyscreen does look fairly abandoned...
Author
Owner

@thorstenkampe commented on GitHub (Feb 17, 2022):

The user interface looks perfectly fine on any Windows terminal (ConEmu, Cmd/Conhost). It's really just Windows Terminal that has this issue:
image

@thorstenkampe commented on GitHub (Feb 17, 2022): The user interface looks perfectly fine on any Windows terminal (ConEmu, Cmd/Conhost). It's really just Windows Terminal that has this issue: ![image](https://user-images.githubusercontent.com/475462/154572503-7b618999-a2cd-452f-b1bd-1c762aa67367.png)
Author
Owner

@elsaco commented on GitHub (Feb 18, 2022):

This is with Windows Terminal Preview Version: 1.13.10395.0 and PowerShell 7.2.1:

wt_12518_pwsh

PowerShell 5:

wt_12518_powershell

@elsaco commented on GitHub (Feb 18, 2022): This is with Windows Terminal Preview Version: 1.13.10395.0 and PowerShell 7.2.1: ![wt_12518_pwsh](https://user-images.githubusercontent.com/3933920/154613163-635ec31b-1646-457c-9649-7cc966e4e839.png) PowerShell 5: ![wt_12518_powershell](https://user-images.githubusercontent.com/3933920/154613229-6429ba94-7112-4921-b662-40030fa68a25.png)
Author
Owner

@thorstenkampe commented on GitHub (Feb 18, 2022):

@elsaco is correct. I had started Windows Terminal from ConEmu (which is still my main terminal application and from which the demo works fine). Starting Windows Terminal from the desktop shows no issue with the text user interface (Npyscreen).

Sorry for the noise, I'm closing the issue.

@thorstenkampe commented on GitHub (Feb 18, 2022): @elsaco is correct. I had started Windows Terminal from ConEmu (which is still my main terminal application and from which the demo works fine). Starting Windows Terminal from the desktop shows no issue with the text user interface (Npyscreen). Sorry for the noise, I'm closing the issue.
Author
Owner

@DHowett commented on GitHub (Feb 18, 2022):

You know, that is still a really interesting outcome. Launching from ConEmu shouldn't cause trouble... unless the ConEmu Hook library is getting loaded inside Terminal (!)

@DHowett commented on GitHub (Feb 18, 2022): You know, that is still a _really_ interesting outcome. Launching from ConEmu shouldn't cause trouble... unless the ConEmu Hook library is getting loaded inside Terminal (!)
Author
Owner

@thorstenkampe commented on GitHub (Feb 18, 2022):

@DHowett yes, ConEmuHK.dll was also my first thought. I disabled the option but no change.

@thorstenkampe commented on GitHub (Feb 18, 2022): @DHowett yes, `ConEmuHK.dll` was also my first thought. I disabled the option but no change.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16806