You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop scrolling to the bottom while echoing something if I am trying to scroll up #318
There is no Scroll lock key on many keyboard these days. Beside I tried On-Screen Keyboard. Scroll lock doesn't seems to be doing what I am suggesting. When something is echoing, it always try to jump on last line, even if I try to scroll up
While not often used today, the scroll lock key was originally intended to be used in conjunction with the arrow keys to scroll through the contents of a text box. It has also been used to stop the scrolling of text ...
Now, the scroll command is no longer associated to scroll lock key in Windows console...
In the above events, I would wait for the user to [Mouse Up] to detect if scroll needs enable/disable, so that visiting last line while dragging scrollbar does not disable scrollock.
An issue is that since the bottom of scroll-buffer is not where the last line has been printed but further down the window, depending on the buffer-lines set. So it should be kind of difficult to locate where the last line is, and maybe the user has a hard time to disable the scroll-lock with the scrollbar, no?
Another feature common among programs implementing this auto-scroll-lock functionality is to have a notification icon signalling when new input has been printed at the bottom.
A feature worth going into the settings is to revert to bottom-line when something gets printed in STDERR, if you have this capability. So there is 2 levels of auto-scroll-lock: ignore STDOUT, and ignore both STDOUT + STDERR. Maybe an icon ob the toolbar would be much more useful for such features.
ConsoleZ reads the console buffer.
Reading STDERR or STDOUT implies creating pipes to redirect STDOUT or STDERR. Unfortunately, when default console handles are replaced by pipes, applications can no longer write text with color.
When Windows console is in "mark" state (scroll-lock), console application cannot output text (execution is blocked in output text functions until "mark" state is disabled).
Actually the console hook reads the text located in screen buffer window. This window automatically follows the cursor. When we scroll, we modify the position of this window (SetConsoleWindowInfo). But every time the cursor position changes, the window returns to the cursor position.
We can try to manage an alternate window position to simulate scroll-lock.
We can stop scroll lock when alternate window Y-position is higher than real window Y-position.
Activity
cbucher commentedon Feb 26, 2016
Hi,
There is a scroll lock key on your keyboard. This is the role of this key.
rhymdsadeelf commentedon Feb 26, 2016
There is no Scroll lock key on many keyboard these days. Beside I tried On-Screen Keyboard. Scroll lock doesn't seems to be doing what I am suggesting. When something is echoing, it always try to jump on last line, even if I try to scroll up
cbucher commentedon Feb 29, 2016
Yes, you're right.
In my time:
Now, the
scrollcommand is no longer associated to scroll lock key in Windows console...cbucher commentedon Nov 20, 2016
@rhymdsadeelf
Sorry for the long time.
You can use "Stop scrolling" command and then scroll up.
There are some possible improvements:
What do you think about these improvements?
rhymdsadeelf commentedon Jan 1, 2017
Sounds perfect to me :)
ankostis commentedon May 28, 2017
Dear @cbucher actually don't bother with the settings-checkbox - really that behavior would be just fine for the default.
ankostis commentedon May 28, 2017
In the above events, I would wait for the user to [Mouse Up] to detect if scroll needs enable/disable, so that visiting last line while dragging scrollbar does not disable scrollock.
An issue is that since the bottom of scroll-buffer is not where the last line has been printed but further down the window, depending on the buffer-lines set. So it should be kind of difficult to locate where the last line is, and maybe the user has a hard time to disable the scroll-lock with the scrollbar, no?
Another feature common among programs implementing this auto-scroll-lock functionality is to have a notification icon signalling when new input has been printed at the bottom.
A feature worth going into the settings is to revert to bottom-line when something gets printed in STDERR, if you have this capability. So there is 2 levels of auto-scroll-lock: ignore STDOUT, and ignore both STDOUT + STDERR. Maybe an icon ob the toolbar would be much more useful for such features.
cbucher commentedon May 31, 2017
ConsoleZ reads the console buffer.
Reading STDERR or STDOUT implies creating pipes to redirect STDOUT or STDERR. Unfortunately, when default console handles are replaced by pipes, applications can no longer write text with color.
When Windows console is in "mark" state (scroll-lock), console application cannot output text (execution is blocked in output text functions until "mark" state is disabled).
Actually the console hook reads the text located in screen buffer window. This window automatically follows the cursor. When we scroll, we modify the position of this window (SetConsoleWindowInfo). But every time the cursor position changes, the window returns to the cursor position.
We can try to manage an alternate window position to simulate scroll-lock.
We can stop scroll lock when alternate window Y-position is higher than real window Y-position.
rshivane commentedon Oct 12, 2017
+1