Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Efficiently reviewing the output buffer in terminals #11172

Closed
Neurrone opened this issue May 17, 2020 · 15 comments · Fixed by #10964
Closed

Efficiently reviewing the output buffer in terminals #11172

Neurrone opened this issue May 17, 2020 · 15 comments · Fixed by #10964
Labels
app/windows-terminal New terminal app, potentially supersedes app/windows-console (repo: microsoft/terminal)
Milestone

Comments

@Neurrone
Copy link

Neurrone commented May 17, 2020

CC: @codeofdusk

Is your feature request related to a problem? Please describe.

I couldn't figure out how to do the following:

  1. Efficiently review text that has scrolled offscreen.
  2. Efficiently copy parts of the buffer to the clipboard that have scrolled offscreen
  3. Find occurances of a search term of interest, which is really useful in many situations. Both the legacy terminal and the new Windows Terminal have a find function which visually highlights matches, but there's no way to move to it with NVDA.
  4. Probably slightly out of scope: dealing with text-based tables. For example, a command line disassembler usually has the memory address in the first column, which you are subjected to hearing on every line when using NVDA even though you're actually interested in the actual CPU instructions. Many useful commands also output statistics in tables which is hard to read.

Describe the solution you'd like

These are just some ideas for now, I'd love to hear how others have solved these issues.

  1. Logging all output to a virtual document: using a key to switch to it, maybe nvda + space, you would then be able to review past output up to e.g, the past 1000 lines. I'm not sure what the performance implications of this are, but it might allow for some possibilities in the future such as turning text-based tables into a table that NVDA recognizes, or turning each prompt line into a heading for faster navigation.
  2. Make use of the hotkeys in the terminal: conhost has the mark mode for this but there are some oddities when trying to use it in practice. This also does not work with the legacy terminal in WSL and is also not supported in Windows Terminal, see Implement scrolling and selection of output text via the keyboard microsoft/terminal#5948.
  3. Use a paging utility

Describe alternatives you've considered

I have therefore been forced to copy all text and paste it into a blank notepad document just to do some of these basic tasks.

@codeofdusk
Copy link
Contributor

For offscreen text there was #9735, but this was rejected in favour of using the native scrolling commands.

@Neurrone
Copy link
Author

Can we revisit #9735? Are there performance concerns if offscreen text can be reviewed? This would be really useful given how poorly the text selection keys are supported.

@codeofdusk
Copy link
Contributor

Cc @feerrenrut.

@Neurrone
Copy link
Author

What are your thoughts on having a virtual document mode that we could fall back on using? Is that technically feasible? E.g, to solve the find problem and maybe tables.

@JulienCochuyt
Copy link
Collaborator

JulienCochuyt commented May 17, 2020

@codeofdusk, if #9735 is ever revived:

  • NVDA+F9 / NVDA+shift+F9 could be used to mark and jump for easier review of the last command executed. Currently, it works only when no scrolling occurred.
  • An approach similar to PR Python Console: Jump to previous/next result (#9784) #9785 could be tested on terminal consoles: jumping to next/previous position where enter was pressed - less efficient than on the Python console, but still a big improvement.

Additionally, a generalized "Find" mechanism is often asked for in situations other than browseable documents. While it can meet caveats in random windows, it could at least search through the same text NVDA+b reads, and would be fairly safe in consoles.

Tables are a much more tricky matter to handle properly...

@Neurrone
Copy link
Author

@JulienCochuyt agreed about tables being much trickier. I only mentioned it because it can only be solved if the output buffer can be rendered in a virtual document, which could affect how this problem is solved. Having a virtual buffer would also make review and find much more pleasant.

@feerrenrut feerrenrut added the app/windows-terminal New terminal app, potentially supersedes app/windows-console (repo: microsoft/terminal) label May 18, 2020
@Neurrone
Copy link
Author

Related: navigation of output by command is tracked in microsoft/terminal#6232

@codeofdusk
Copy link
Contributor

It was mentioned in microsoft/terminal#6453 (comment) that some new console text can actually appear below the visible range, making it completely inaccessible to NVDA.

Additionally, there are plans to automatically detect (and make clickable) links in Conhost and Terminal (see microsoft/terminal#7691).

I think it makes sense to do the following:

As an initial implementation, I tried setting winConsoleUIA.treeInterceptorClass to UIABrowseMode.UIABrowseModeDocument and shouldCreateTreeInterceptor to False, but the virtual buffer was confined to one line of text. Am I missing something?

Cc @carlos-zamora, @LeonarddeR, @michaelDCurran.

@zersiax
Copy link

zersiax commented Feb 21, 2021

Bump. Is this still on the backlog? TO what degree does the new diffing algorithm in alpha builds contribute to this?

@codeofdusk
Copy link
Contributor

I'll re-evaluate after microsoft/terminal#6986.

@codeofdusk
Copy link
Contributor

OK, looks like all but 4 are fixed with #10964.

@seanbudd
Copy link
Member

Is 4 fixed with #12928?

@codeofdusk
Copy link
Contributor

It is not, and was listed as out of scope for this issue.

seanbudd pushed a commit that referenced this issue Jun 21, 2022
…(Windows 11 Sun Valley 2) (#10964)

Supersedes #9771 and #10716. Closes #1682. Closes #8653. Closes #9867. Closes #11172. Closes #11554.

Summary of the issue:

Microsoft has significantly improved performance and reliability of UIA console:
* microsoft/terminal#4018 is an almost complete rewrite of the UIA code which makes the console's UIA implementation more closely align with the API specification.
* microsoft/terminal#10886, microsoft/terminal#10925, and microsoft/terminal#11253 form a robust testing methodology for the UIA implementation, including bug fixes in response to newly added tests based on Word's UIA implementation.
* microsoft/terminal#11122 removes the thousands of empty lines at the end of the console buffer, significantly improving performance and stability. Since all console text ranges are now within the text buffer's bounds, it is no longer possible for console to crash due to the manipulation by UIA clients of an out-of-bounds text range.
* Countless other accessibility-related PRs too numerous to list here.

We should enable UIA support on new Windows Console builds by default for performance improvement and controllable password suppression.

Description of how this pull request fixes the issue:

This PR:
* Exposes all three options for the UIA console feature flag in the UI (replaces the UIA check box with a combo box).
* Adds a runtime check to test if `apiLevel >= FORMATTED`, and use UIA in this case when the user preference is auto. This is the case on Windows 11 Sun Valley 2 (SV2) available now in beta and set for release in the second half of 2022.
@nvaccessAuto nvaccessAuto modified the milestone: 2022.3 Jun 21, 2022
@Neurrone
Copy link
Author

Some of the scenarios in the issue hasn't been addressed. For example, the ability to efficiently find and navigate to matches of search terms.

@codeofdusk
Copy link
Contributor

codeofdusk commented Jun 22, 2022

Ctrl+f now works (it didn't in legacy), at least to find an initial match. F3 to move to the next match doesn't seem to work for me, but that's a Microsoft issue (i.e. out of scope for NVDA).

@seanbudd seanbudd reopened this Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/windows-terminal New terminal app, potentially supersedes app/windows-console (repo: microsoft/terminal)
Projects
None yet
7 participants