microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.08k stars 29.25k forks source link

Terminal Scroll bar appears in the middle #91135

Closed goxr3plus closed 4 years ago

goxr3plus commented 4 years ago

Gif attached below :

2020-02-21_11-37-58

Also sometimes when i opper two terminals side by side and i close the second , the first one doesn't resize properly .

image

Version: 1.43.0-insider (system setup) Commit: e6a45f4242ebddb7aa9a229f85555e8a3bd987e2 Date: 2020-02-21T05:42:20.536Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18363

gjsjohnmurray commented 4 years ago

Does this also occur if you run from command line and disable GPU?

code --disable-gpu

IllusionMH commented 4 years ago

This might be related to the fact that after I hide/show bottom panel there is difference in width of div.terminal.xterm

Fresh terminal in bottom panel image Click hide panel or switch to any other tab in panel and show terminal again image

Which might explain issue with wrong outline in #90568 (and issues that I had when sometimes input line had line breaks early)

It looks funnier immediately after I switch from experimentalWebgl renderer to auto and terminal is hot-reloaded. image (after hot reload of renderer I also see that in this case I also see that .split-view-view.visible will change it width, but doesn't happen in case described above)

VS Code version: Code - Insiders 1.43.0-insider (e6a45f4242ebddb7aa9a229f85555e8a3bd987e2, 2020-02-21T05:42:20.536Z) OS version: Windows_NT x64 10.0.18363

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.72GB (11.59GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions: none
Tyriar commented 4 years ago

I suspect a race where viewport doesn't update when resize is fired multiple times in quick succession.

Tyriar commented 4 years ago

@sbatten I think the workbench view refactor caused this and https://github.com/microsoft/vscode/issues/91119. Are there additional resize events being fired now when the view is hidden?

sbatten commented 4 years ago

image

initial layout calls, after initial layout no more calls to layout are made with terminal hidden.

/cc @joaomoreno

IllusionMH commented 4 years ago

Not sure if directly related to this one (most likely same as second case in my example with renderer). If I change editor.font I'll get wrong dimensions for teriminal inside tab. No resizing or hiding tab in this case. image

Tyriar commented 4 years ago

Solid repro: https://github.com/microsoft/vscode/issues/91135

Tyriar commented 4 years ago

@sbatten please review https://github.com/microsoft/vscode/commit/622ddc0d6794450de81bdd4fd020dd219be1b926, also why does layoutBody take height first then width? This is backwards to the standard and results in things like this happening?

sbatten commented 4 years ago

not sure, @joaomoreno implemented it that way a long time ago.

joaomoreno commented 4 years ago

What standard?

Historically, split views only had one dimension, so it was layout(size). Then, as panels appeared, they were forcibly vertical, so layout(size) would call layoutBody(height). Then, it turns out we needed to pass in width as well, so then layoutBody(height, width) was born. As far as the splitview is concerned, the method is layout(size, orthogonalSize), so we're agnostic there.

@sbatten This can easily be changed to a layoutBody(dimension) at the panel layer.

Tyriar commented 4 years ago

@joaomoreno by standard I mean industry standard that it's almost always (x, y), (width, height), (horizontal, vertical), etc.