question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escape character garbage on command line (Win81)

See original GitHub issue

I’ve been using PWSH 6.1.1 since introduced and that shell has been working great, mostly. Decided to give the 7.0.0-rc.2 a run…

  • Good News: start up is 25% faster
  • Bad news: Lots of escape character garbage on command line, appearing as soon as you type anything. (In particular the [104m.)

Steps to reproduce

# type a "$" (the first one is part of the prompt)
$ $⬜[104m

(I had to manually paste a box character above, since it didn’t show in the github markup.)

----------------------------------------------------------
  PowerShell Version    : 7.0.0-rc.2
  OS Name               : Microsoft Windows 8.1 (64-bit)
  OS Version            : 6.3.9600  [2014-08-16 00:50:01]
  OS BuildLabEx         : 9600.19538
  OS HAL                : 6.3.9600.18969
  OS Kernel             : 6.3.9600.18217
  OS UBR                : 19599
  -------------------------------------------------------
  on Host               : xxxx
  as User               : xxxx
  with Privilege        : Administrator
  -------------------------------------------------------
  ExecutionPolicy :
        MachinePolicy   : Undefined
        UserPolicy      : Undefined
        Process         : Undefined
        CurrentUser     : Bypass
        LocalMachine    : RemoteSigned

  Console Settings:
      Type              : ConsoleHost
      OutputEncoding    : Unicode (UTF-8)
      Color Capability  : 151
      Registry VT Level : 1
      CodePage (input)  : 437
      CodePage (output) : 437
      Mode (input)      : 0x1f7
      Mode (output)     :

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.2
PSEdition                      Core
GitCommitId                    7.0.0-rc.2
OS                             Microsoft Windows 6.3.9600
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Related issue with further descriptions:

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
daxian-dbwcommented, May 18, 2020

I think you should be able to remove it by:

  1. Close all pwsh instances
  2. pwsh -nonprofile -noninteractive from CMD.exe
  3. Remove-Module -FullyQualifiedName @{ ModuleName = "PSReadLine"; ModuleVersion = "2.1" }

PSReadLine is loaded at powershell startup. Once the assembly is loaded, the assembly file on disk cannot be removed. Maybe that’s why you couldn’t uninstall it. -noprofile -noninteractive basically tells powershell to start without loading PSReadLine.

1reaction
daxian-dbwcommented, May 15, 2020

Can you tell me how to install and run a later PSReadLine ?

Sure, you will find the “Upgrading” section helpful: https://github.com/PowerShell/PSReadLine#upgrading You probably should avoid the 2.1.0-beta1 version of it, because it contains an experimental feature “Predictive Suggestion” that doesn’t work well on downlevel Windows like Win 8.1. But knowing the upgrading instructions will help you get to latest PSReadLine in future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Escape character garbage on command line (Win81) #11685
I've been using PWSH 6.1.1 since introduced and that shell has been working great, mostly. Decided to give the 7.0.0-rc.2 a run.
Read more >
Escape sequences unprocessed under the "cygwin" terminal
1 Answer. In order for an application to be able to use ANSI escape sequences when launched from cmd.exe ( TERM=cygwin ), either...
Read more >
Windows 10 show garbage characters
Open Control Panel and go to Appearance and Personalization. Appearance. Now under Fonts select Change Font Settings. Fonts. In the new window ......
Read more >
Help for all Microsoft Windows 8.1 Pro commands
GRAFTABL, Enables Windows to display an extended character set in graphics mode. ... To include special characters in the command line, ...
Read more >
Weird garbage (ansi escape characters?) in terminal when ...
I have a script, that when run sometimes/often outputs an "unescaped" ANSI escape sequence when encountering this line:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found