skip restoring terminals with missing working directory - #2878
Conversation
8f2498c to
103db30
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
|
@vogella Would you like to review this? |
Sure. Looks good, except: Path.of(workingDirectory) can throw InvalidPathException. Why not using new File(workingDirectory).isDirectory()? |
As an alternative, @danthe1st you need to catch the exception. |
Of course that wouldn't hurt, But I also don't think there is a compelling need because the value was used as a working directory. The exception appears to be handled mostly only where user input is involved, i.e., where the user could type anything completely bogus:
|
I disagree, the value is read from persisted memory and so much can go wrong with re-reading as persisted value, encoding, OS updates, moved, etc. Checking the exception or avoiding it is mandatory here. |



Since we already have M3 now, this may be better for Eclipse 2026-12 but that's a decision for committers.
With restoring terminals now properly restoring the working directory, it doesn't really make sense to restore terminals pointing to a directory that no longer exists so this PR skips restoring these terminals (see also #2859).
I also used this chance to extract the logic for restoring a single terminal from the stored connection properties into a method for better readability.