Open Eugeny opened 6 years ago
Hmm... Right now, the scrollbar listens for certain events to know when something happened in the terminal that we might need to update for (see https://github.com/kbjr/terminus-scrollbar/blob/master/src/scrollbar/scrollbar.ts#L64-L66).
Is there some other event I can watch for that would notify of this? Perhaps something related to the Ctrl+C signal?
There's a alternateScreenActive$ Observable that fires when entering and exiting the alternate screen - see if that helps
(it's on the TerminalTab object)
I've pushed out version 0.1.2 which, as far as I can tell, does seem to behave correctly. But I'm testing on Windows, and there is probably some nuance there between Windows/*nix. Can you confirm?
Still doesn't quite work for me. When entering htop
, the scrollbar still stays in "normal" mode:
Htop continuously updates screen, so onTerminalUpdate
gets called all the time.
I'm running macOS, but starting htop inside WSL or Cygwin should give you the same result.
If you actually scroll up, what happens? Because it determines the scrollbar height and position based off of the actual height and position of the terminal element (the x-screen
element inside the hterm iframe), so if its showing that there is room to scroll, there probably actually is (whether there "should" be or not). If that's the case, I don't know if I can magic that away.
There's probably "physical" room available for scroll, but entering alternate screen mode means that the app intends to go full screen and probably handle keyboard/mouse input directly. For instance htop
catches scroll events and aptitude
ignores then completely.
I'd say the scrollbar should go invisible when AS is active.
That event actually doesn't seem to trigger in WSL either (except when first opening the terminal). I published a version 0.2.0-1
with the event set up to hide the scrollbar, can you confirm that it is working as expected?
The scrollbar disappears properly, but when exiting an AS app, it doesn't reappear until the next output event
When returning to the normal screen buffer from the alternate one, scrollbar position and size are incorrect.
STR: 1: Create some output for the scrollbar to show 2: Run
htop
,aptitude
or similar 3: Exit it (Ctrl-C)