fix: use full executable path for editors on Windows in Git BashFix/edit intellij windows gitbash#2451
Closed
Bhumika-SN wants to merge 3 commits into
Closed
Conversation
maxandersen
reviewed
May 8, 2026
| private static List<String> findEditorsOnPath() { | ||
| return Arrays.stream(knownEditors).filter(e -> Util.searchPath(e) != null).collect(Collectors.toList()); | ||
| return Arrays.stream(knownEditors) | ||
| .filter(e -> Util.searchPath(e) != null) |
Collaborator
There was a problem hiding this comment.
this is going to 2x the calls to searchPath() that does not seem right.
Collaborator
There was a problem hiding this comment.
can't we simply return the right name ? idea.bat ? or exec it shell?
maxandersen
reviewed
May 8, 2026
| dir = Paths.get(System.getProperty("user.home")).resolve(".jbang"); | ||
| // On Windows, USERPROFILE is more reliable than user.home for non-ASCII | ||
| // usernames | ||
| String home = Util.isWindows() |
maxandersen
reviewed
May 8, 2026
| depCache = null; | ||
| // Also clear the dependency cache JSON file from disk | ||
| try { | ||
| Path cacheFile = Settings.getCacheDependencyFile(); |
Collaborator
There was a problem hiding this comment.
this does not seem related to this issue?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Fixes #1340
On Windows with Git Bash,
jbang editfinds IntelliJ'sideaon PATHcorrectly but then tries to execute just
"idea"instead of the fullpath like
"idea.bat".Util.searchPath()correctly resolves the full path with extension,but
findEditorsOnPath()was discarding that result and returningjust the plain editor name.
Fix
On Windows, use the full resolved path returned by
Util.searchPath()instead of the plain editor name, so Git Bash can execute it correctly.