vscode icon indicating copy to clipboard operation
vscode copied to clipboard

resizing terminal stretches text somtimes

Open joshribakoff-sm opened this issue 2 years ago • 2 comments

We have written the needed data into your clipboard because it was too large to send. Please paste.

Type: Bug

sometimes when resizing some panes have text super large & distorted, other panes do not have the issue.

VS Code version: Code - Insiders 1.71.0-insider (Universal) (b0895f9fcc5b49587a2b187a92bbe6d7efae35fa, 2022-08-08T05:19:27.279Z) OS version: Darwin x64 21.6.0 Modes: Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 5, 4, 3
Memory (System) 32.00GB (4.36GB free)
Process Argv --crash-reporter-id 4f6f994d-06c3-4289-b6cd-8f17e07dfe06
Screen Reader no
VM 0%
Extensions (6)
Extension Author (truncated) Version
vscode-eslint dba 2.2.6
prettier-vscode esb 9.5.0
vscode-jest-runner fir 0.4.48
vscode-graphql Gra 0.7.1
vscode-graphql-syntax Gra 1.0.4
angular-console nrw 17.19.1
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256197
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411cf:30542925
vsaa593cf:30376535
pythonvs932:30404738
wslgetstarted:30449409
vscscmwlcmt:30465136
cppdebug:30492333
pylanb8912:30522163
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253

joshribakoff-sm avatar Aug 09 '22 00:08 joshribakoff-sm

Screen Shot 2022-08-08 at 5 09 47 PM

joshribakoff-sm avatar Aug 09 '22 00:08 joshribakoff-sm

Same problem here (but horizontally) and for me scrolling in the pane with stretched/squashed text doesn't work anymore. I can still move the scrollbar, but nothing happens.

LeanderD avatar Aug 10 '22 10:08 LeanderD

This may be fixed with the fix for https://github.com/microsoft/vscode/issues/157444

Tyriar avatar Aug 10 '22 14:08 Tyriar

Steps to repro and the error we've been seeing in the console described here https://github.com/microsoft/vscode/issues/158468

meganrogge avatar Aug 18 '22 11:08 meganrogge

Don't think it's fixed as I've seen the error in the console in insiders

meganrogge avatar Aug 18 '22 11:08 meganrogge

The error from https://github.com/microsoft/vscode/issues/158468

Uncaught TypeError: Cannot read properties of undefined (reading 'ext')
    at e._loadColorsForCell (WebglRenderer.ts:404:95)
    at e._updateModel (WebglRenderer.ts:351:14)
    at e.renderRows (WebglRenderer.ts:298:10)
    at t._renderRows (RenderService.ts:124:20)
    at e._renderCallback (RenderService.ts:64:70)
    at e._innerRefresh (RenderDebouncer.ts:72:10)
    at RenderDebouncer.ts:51:68

Related: https://github.com/microsoft/vscode/issues/157715

Tyriar avatar Aug 18 '22 15:08 Tyriar

I wonder if this is related to the resize observer occurring for a previous canvas update but it not firing for the current change when resizes occur in quick succession? https://github.com/xtermjs/xterm.js/blob/c0ef2ccb5a0b2f22f28ed594f3962d75cc83da00/src/browser/renderer/DevicePixelObserver.ts#L9

Example:

  • Canvas is changed to to 5x10, resize observer is queued
  • Canvas is changed to 10x10, resize observer does not get queued for some reason?
  • Resize observer is fired for 5x10 only?

Tyriar avatar Aug 23 '22 15:08 Tyriar

Just stumbled over this in the final 1.71 release. Like @LeanderD said, this also breaks scrolling in terminal.

Screen Shot 2022-09-01 at 13 09 20

janosh avatar Sep 01 '22 20:09 janosh

Consistently gets this error. It seems it occurs when outpout in a bash terminal window is larger than the current window, e.g. I can replicate it by running a "npm outdated" command that has a wide and long output. Window content including characters will then crudely be zoomed in/out when terminal window is resized, and not re-rendered as it used to be before 1.71

image

Scrolling does not work, and will eventually make the output disappear totally, leaving the terminal window in an unusable state (kill is the only option out)

gkn avatar Sep 02 '22 10:09 gkn

+1 I am able to reproduce this every time and it is quite annoyin

fparhat-rbi avatar Sep 02 '22 17:09 fparhat-rbi

Same issue for me: Screenshot 2022-09-04 at 14 07 22

asdutoit avatar Sep 04 '22 12:09 asdutoit

Same here on 1.71.0

dmitri-suvorov-sumup avatar Sep 06 '22 12:09 dmitri-suvorov-sumup

Anyone seeing this could you provide you window.zoomLevel setting and what the output is when you open developer tools (help menu), go to console and run window.devicePixelRatio?

Tyriar avatar Sep 06 '22 13:09 Tyriar

Anyone seeing this could you provide you window.zoomLevel setting and what the output is when you open developer tools (help menu), go to console and run window.devicePixelRatio?

devicePixelRatio

dmitri-suvorov-sumup avatar Sep 06 '22 13:09 dmitri-suvorov-sumup

Zoom level normal, window.devicePixelRatio=1

I also noticed that I keep getting the following error in VS Code Dev tools:

WebglRenderer.ts:404 Uncaught TypeError: Cannot read properties of undefined (reading 'ext') at e._loadColorsForCell (WebglRenderer.ts:404:95) at e._updateModel (WebglRenderer.ts:351:14) at e.renderRows (WebglRenderer.ts:298:10) at t._renderRows (RenderService.ts:124:20) at e._renderCallback (RenderService.ts:64:70) at e._innerRefresh (RenderDebouncer.ts:72:10) at RenderDebouncer.ts:51:68

gkn avatar Sep 06 '22 14:09 gkn

Thanks @gkn and @dmitri-suvorov-sumup, that's useful

Tyriar avatar Sep 06 '22 14:09 Tyriar

A workaround until this bug is fixed, is to disable WebGL in settings, e.g.: "terminal.integrated.gpuAcceleration": "canvas"

gkn avatar Sep 09 '22 06:09 gkn

Looks like all reports are on macOS

Tyriar avatar Sep 09 '22 17:09 Tyriar

Hey @Tyriar, I'm having the same issue on Fedora 36 running on Gnome. I can include more details if needed. The solution posted by @gkn did work for me as a temp workaround.

brauliolledo avatar Sep 09 '22 18:09 brauliolledo

@brauliolledo thanks for letting me know

Tyriar avatar Sep 09 '22 18:09 Tyriar

Recording showing the issue: https://github.com/microsoft/vscode/issues/160508#issuecomment-1241796756

Tyriar avatar Sep 09 '22 18:09 Tyriar

I've tried and tried, can't reproduce. Will dig into the code and make a defensive change for the thrown exception if I can't find the problem.

Tyriar avatar Sep 09 '22 18:09 Tyriar

This is probably where undefined slips in: https://github.com/xtermjs/xterm.js/blob/f9db65c52e4702cf906c14cda1c640342a7b6dca/src/common/buffer/BufferLine.ts#L183-L185

Tyriar avatar Sep 09 '22 18:09 Tyriar

Can reproduce 🎉 it's an issue with extended attributes (ie. underline style and color) conflicting with line reflow:

  1. Open bash on macOS or Linux
  2. Run ls -la to fill viewport
  3. Run echo -e '\x1b[4:1masnmdnasdkjlanmlsdkmnalskdmnlaksdmnlaksdmnlaksdlaksdmlkasmdlas\x1b[0m'
  4. Reduce the size of the window, errors appear in the console

Repro may be easier in split panes

Tyriar avatar Sep 09 '22 19:09 Tyriar

Upstream issue: https://github.com/xtermjs/xterm.js/issues/4108

Tyriar avatar Sep 09 '22 19:09 Tyriar

Seems like @Tyriar has found the issue now but for the record, I get this error on VS Code running on Windows 10 with WSL2 Ubuntu 20.

gkn avatar Sep 09 '22 20:09 gkn

I'm seeing similar behavior to the described issue using the latest VSCode on macOS:

Screen Recording 2022-09-23 at 02 02 47 PM

image

This is new, only occurring in the past few weeks.

danawoodman avatar Sep 23 '22 21:09 danawoodman

Same story here: The issue is happening to me on the latest versions of Visual Studio Code and macOS. It seems like turning off GPU rendering for the terminal works for the time being, while the issue is being fixed…

leafac avatar Sep 27 '22 15:09 leafac

Pretty sure we gotta wait till https://github.com/microsoft/vscode/commit/b24fefc5403ae8152db6d79eb80333f77e199a6f makes it into one of the release tags and an update published.

kaovilai avatar Sep 28 '22 17:09 kaovilai

Same story here: The issue is happening to me on the latest versions of Visual Studio Code and macOS. It seems like turning off GPU rendering for the terminal works for the time being, while the issue is being fixed…

@leafac what's the setting for that please?

edit:

...
"terminal.integrated.gpuAcceleration": "off"
...

airtonix avatar Oct 05 '22 01:10 airtonix