terminal: Console doesn't handle colored regions when reflowed

  • Your Windows build number: (Type ver at a Windows Command Prompt) FCU

  • What you’re doing and what’s happening: (Copy & paste specific commands and their output, or include screen shots)

  1. Open Ubuntu session in Console
  2. Execute the following:
$ cd ~/
$ mkdir temp
$ cd temp
$ mkdir hello
$ mkdir world
$ clear 
$ ls
  1. Grab & drag right-hand Console window edge to resize window width

Expected:

Folders’ colored background should only extend to the end of the folder name:

image

Actual:

Lines with folders that are last item on line extend folder background coloring to right hand end of line:

image

See the following for an example of where it goes very wrong: image

And it gets worse when lines wrap! image

References

Thanks to @jmorrill for reporting here: https://twitter.com/jmorrill/status/915982968094580736

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 21
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

FWIW, I discovered a workaround as a result of posting this question to stackoverflow. If you write a non-breaking space, like so:

write-host ‘hello’ -f ‘red’ -b ‘cyan’ -n; write-host ([char]0xA0)

patches the issue. Works in Windows Terminal, Windows Console and Fluent Terminal. Not sure if this is an issue on macOS with iterm2/terminal (not sure about linux).