Improved foreground process identification #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR updates the match statement so that it covers Windows directories (backslash for dirs) as well as unix-based systems (forward slash).
I created this as a draft because I'd like to test it some more on various platforms with different processes running and also to get some feedback.
If a foreground process isn't found (which is expected behaviour for most non-local domains), the idea is to then check the domain name. If it isn't a local domain, we would then use the domain name for the process name, because resolving the foreground process won't be possible.
If we're dealing with a local domain and couldn't resolve a foreground process name, the idea is to use the tab title as the process name. Wezterm will attempt to resolve the OSC 1/2 sequences to fill in a title name (see get_title in Wezterm docs), and the title will default to "Wezterm" otherwise.
I know Windows has some odd behaviour with OSC 2 sequences that I'd like to test further as well to see what the tab title gets set to, and whether we would need to do some matching for Windows PCs.