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

Include terminal name in terminal textarea title #99072

Closed
Tyriar opened this issue Jun 2, 2020 · 17 comments · Fixed by #100087 or #112317
Closed

Include terminal name in terminal textarea title #99072

Tyriar opened this issue Jun 2, 2020 · 17 comments · Fixed by #100087 or #112317
Assignees
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues verified Verification succeeded
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 2, 2020

Currently focusing the terminal reads something like "Terminal 1", "Terminal 2". It should read "Terminal 1, bash", "Terminal 2, (custom title)", etc.

Context: #95573 (comment)

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues good first issue Issues identified as good for first-time contributors terminal Integrated terminal issues labels Jun 2, 2020
@Tyriar Tyriar added this to the Backlog milestone Jun 2, 2020
@Tyriar Tyriar self-assigned this Jun 2, 2020
@chrisnorman7
Copy link

Or simply the title you set... Maybe the title, then "Terminal 1" in brackets?

@chrisnorman7
Copy link

Or maybe go absolutely wild, and have it as a configurable string. Something like "$n (Terminal $i)", where $n is the name you set, and $i is the index.

@tabaddor
Copy link
Contributor

tabaddor commented Jun 3, 2020

I can look into fixing this issue if it is still open, although I do see it has been added to the backlog.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 4, 2020

@tabaddor please do 🙂, the backlog for us essentially means we want to do this eventually.

@tabaddor
Copy link
Contributor

tabaddor commented Jun 8, 2020

On it. @chrisnorman7 Quick clarification, but what was meant by "custom title" in the issue description above?

I guess more specifically, with Terminal X, (custom), is the (custom) the user's choice? How will that terminal name be determined? (looking at the context linked above, it seems it should be what was set for the rename terminal action)

Additionally, before I delve into the source code, can you briefly clarify "focusing" on the textarea @Tyriar? Can't seem to recreate that on the development version or released version.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 8, 2020

@tabaddor by custom I mean when you rename a terminal via this command:

image

Additionally, before I delve into the source code, can you briefly clarify "focusing" on the textarea @Tyriar? Can't seem to recreate that on the development version or released version.

The label is set here:

xterm.textarea.setAttribute('aria-label', nls.localize('terminalTextBoxAriaLabel', "Terminal {0}", this._id));

You'll need a screen reader to verify whether it's read correctly but I expect the change to be on that line.

@chrisnorman7
Copy link

chrisnorman7 commented Jun 8, 2020 via email

@tabaddor
Copy link
Contributor

tabaddor commented Jun 13, 2020

I anticipate changing this line:

xterm.textarea.setAttribute('aria-label', nls.localize('terminalTextBoxAriaLabel', "Terminal {0}", this._id));

to this:

xterm.textarea.setAttribute('aria-label', nls.localize('terminalTextBoxAriaLabel', "Terminal {this._id}, {this._title}"));

Though prior to setting this attribute I anticipate I will need to add a check to see if the title was set or not, along with ensuring this attribute is updated on title changes (renamed instances). Although the latter should already be accounted for.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 13, 2020

To get localization to work it will need to be "Terminal {0}, {1}", this._id, this._title), and yes good thinking we should have an if in there are 2 separate nls.localize calls, one with and one without the title.

@tabaddor
Copy link
Contributor

tabaddor commented Jun 13, 2020

Will submit a PR shortly.

@roblourens
Copy link
Member

roblourens commented Jul 2, 2020

Where should I see this? When I focus the terminal, voiceover reads "Terminal 1, edit text, complentary"

image

@alexr00
Copy link
Member

alexr00 commented Jul 6, 2020

I'm also not getting what I'd expect from this issue.

What's read:
Terminal 2 edit
blank

Red dot where I clicked:
image

What I'd expect that to read: "Terminal 2 powershell"

@alexr00 alexr00 added the verification-found Issue verification failed label Jul 6, 2020
@alexr00 alexr00 reopened this Jul 6, 2020
@Tyriar Tyriar removed the verification-found Issue verification failed label Jul 7, 2020
@Tyriar Tyriar modified the milestones: June 2020, July 2020 Jul 7, 2020
@Tyriar Tyriar removed this from the July 2020 milestone Jul 29, 2020
@Tyriar Tyriar added this to the Backlog milestone Jul 29, 2020
@weisun022
Copy link

I'm going to take a shot at this for Grace Hopper's Open Source Day!

@isidorn
Copy link
Contributor

isidorn commented Oct 1, 2020

Here's a code poitner (not specific enough though)

export class TerminalViewPane extends ViewPane {

@plainerman
Copy link
Contributor

I see that this issue hasn't been fully resolved as of now. I would like to try to fix it if it is still available to work on.

As I am completely new to this project, I would appreciate some code pointers. With the pointers above I have already found out where the string "said by the narrator" is set. But could someone point me to the entry point for Terminal:Rename?

Thank you, looking forward to making my first contribution.

plainerman added a commit to plainerman/vscode that referenced this issue Dec 11, 2020
Move setting the custom title from the attachment function to setTitle. setTitle will be called anyway, resolving this issue
@plainerman
Copy link
Contributor

plainerman commented Dec 11, 2020

I found the entry point of Terminal:Rename and have resolved the issue.
A pull request has been created at #112317.

If anyone is searching for the entry point, see

async run(accessor: ServicesAccessor) {

@isidorn
Copy link
Contributor

isidorn commented Dec 14, 2020

Thanks a lot for creating a PR!

@Tyriar Tyriar modified the milestones: Backlog, February 2021 Jan 19, 2021
@Tyriar Tyriar modified the milestones: February 2021, January 2021 Jan 19, 2021
@rzhao271 rzhao271 added the verified Verification succeeded label Jan 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues verified Verification succeeded
Projects
None yet
11 participants