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

UIA Word Navigation #3161

Closed
carlos-zamora opened this issue Oct 11, 2019 · 7 comments · Fixed by #3659
Closed

UIA Word Navigation #3161

carlos-zamora opened this issue Oct 11, 2019 · 7 comments · Fixed by #3659
Assignees
Labels
Area-Accessibility Issues related to accessibility Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@carlos-zamora
Copy link
Member

Description of the new feature/enhancement

UIATextRanges don't know how to move by "word" because a terminal doesn't really know what a "word" is. This is a place to discuss what that should look like.

Proposed technical implementation details (optional)

For Windows Terminal, the user defined "wordDelimiters" and the space character could be used for this.

For ConHost, the user can't define a "wordDelimiter". So, should we just use the space character?

@carlos-zamora carlos-zamora added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Conhost For issues in the Console codebase Area-Accessibility Issues related to accessibility Product-Terminal The new Windows Terminal. labels Oct 11, 2019
@carlos-zamora carlos-zamora added this to the Terminal-1910 milestone Oct 11, 2019
@carlos-zamora carlos-zamora self-assigned this Oct 11, 2019
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 11, 2019
@carlos-zamora
Copy link
Member Author

Related to #2160. Might even be the same??

@ZoeyR
Copy link
Contributor

ZoeyR commented Oct 11, 2019

I don't think its the same as #2160 since the text navigation helpers explicitly decide that requests to move by word should just do line navigation instead.

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 14, 2019
@zadjii-msft
Copy link
Member

As an aisde, you technically can set wordDelimiters for conhost. We'll read that setting from the registry, but never exposed a UI for it ¯\_(ツ)_/¯

|`WordDelimiters` |REG_SZ |A list of characters that are considered as delimiting words (e.g. `' .-/\=|,()[]{}'`) |

auto& delimiters = ServiceLocator::LocateGlobals().WordDelimiters;
delimiters.clear();
Status = RegistrySerialization::s_QueryValue(hConsoleKey,
CONSOLE_REGISTRY_WORD_DELIM,
sizeof(dwValue),
REG_DWORD,
reinterpret_cast<BYTE*>(&dwValue),
nullptr);
if (!NT_SUCCESS(Status))
{
// the key isn't a REG_DWORD, try to read it as a REG_SZ
const size_t bufferSize = 64;
WCHAR awchBuffer[bufferSize];
DWORD cbWritten = 0;
Status = RegistrySerialization::s_QueryValue(hConsoleKey,
CONSOLE_REGISTRY_WORD_DELIM,
bufferSize * sizeof(WCHAR),
REG_SZ,
reinterpret_cast<BYTE*>(awchBuffer),
&cbWritten);
if (NT_SUCCESS(Status))
{
// we read something, set it as the word delimiters
const std::wstring regWordDelimiters{ awchBuffer, cbWritten / sizeof(wchar_t) };
for (const wchar_t wch : regWordDelimiters)
{
if (wch == '\0')
{
break;
}
delimiters.push_back(wch);
}
}
else
{
// the key isn't a REG_DWORD or a REG_SZ, fall back to our default word delimiters
delimiters = { '\\', '+', '!', ':', '=', '/', '.', '<', '>', ';', '|', '&' };
}
}

@carlos-zamora
Copy link
Member Author

oooh. If that's the case, then we can make the UIA Provider read what the wordDelimiters are. Then, just have it read them differently according to the project. We already have a set of UIA Providers for ConHost and another for Terminal (both with the same base class).

@ZoeyR
Copy link
Contributor

ZoeyR commented Nov 8, 2019

Why not use the definition of a word boundary as defined by unicode? http://www.unicode.org/reports/tr29/#Word_Boundaries

@DHowett-MSFT
Copy link
Contributor

If somebody has the time to implement that as an alternative to user-requested word delimiters (fwiw: users want all sorts of things, and they were already fairly cross with us for shipping a delimiter set that included / and \ by default)), I'd entertain it 😄

I imagine the same would extend to "move by word"... but I'm not sure

@ghost ghost added the In-PR This issue has a related PR label Nov 21, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 12, 2019
@ghost
Copy link

ghost commented Jan 14, 2020

🎉This issue was addressed in #3659, which has now been successfully released as Windows Terminal Preview v0.8.10091.0.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants