Skip to content

Empty path to OSC 9;9; crashes Terminal window #12378

Closed
@kstauffer

Description

@kstauffer

Windows Terminal version

1.13.10336.0

Windows build number

10.0.19042.1466

Other Software

No response

Steps to reproduce

In WSL bash, echo $'\e]9;9;\e\\'

Expected Behavior

Terminal should keep running. I don't know if the devs think an empty path should be treated as a no-op or like a well-formed path to a non-existent directory. For example, \e]9;9;/foo\e\\\ sets the directory to /.

Actual Behavior

Terminal window hangs immediately (tested by running date in a tight loop in the background) and crashes a second later.

Activity

ghost added
Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
on Feb 5, 2022
ghost added
Needs-Tag-FixDoesn't match tag requirements
on Feb 5, 2022
added this to the Terminal v1.14 milestone on Feb 5, 2022
added
Issue-BugIt either shouldn't be doing this or needs an investigation.
on Feb 5, 2022
j4james

j4james commented on Feb 6, 2022

@j4james
Collaborator

This was something I was planning to look at as a followup PR #12247. In the same way that AdaptDispatch and ConGetSet are designed to throw exceptions for error handling, the equivalent Terminal classes TerminalDispatch and ITerminalApi should be doing the same thing. That way exceptions like this would be caught in the StateMachine and recovered gracefully.

I had initially planned to leave this till I was further along refactoring the conhost side of things, but maybe it's a good idea to get it done sooner rather than later if it'll save users from having a crashed terminal. Any objections to that?

j4james

j4james commented on Feb 6, 2022

@j4james
Collaborator

I should add that this isn't necessarily a fix for the OSC 9;9 handling - I'm not sure what the correct behaviour is for that. I just want to make sure the terminal isn't needlessly crashing in situations like this.

zadjii-msft

zadjii-msft commented on Feb 7, 2022

@zadjii-msft
Member

I agree. At the very least, we should fix this crash now, so we can service the fix to the in-market builds.

ghost removed
Needs-Tag-FixDoesn't match tag requirements
on Feb 7, 2022
ghost removed
Needs-Tag-FixDoesn't match tag requirements
on Feb 7, 2022

13 remaining items

added and removed
In-PRThis issue has a related PR
on Feb 11, 2022
j4james

j4james commented on Feb 11, 2022

@j4james
Collaborator

I am gonna move it out of the 1.14 milestone though, just for the sake of work tracking.

Yeah, that makes perfect sense. I've just checked ConEmu now and it looks like a blank path is simply ignored, i.e. it retains the last valid path that was set. So what we have is technically correct - it's just a code health issue now.

added a commit that references this issue on Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsPriority-2A description (P2)Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Participants

    @DHowett@j4james@kstauffer@zadjii-msft

    Issue actions

      Empty path to OSC 9;9; crashes Terminal window · Issue #12378 · microsoft/terminal