Commit Graph

28 Commits

Author SHA1 Message Date
ehedlund
02fc2aaef2 fix(core): resolve infinite loop and improve editor selection flow
- Fixes an infinite loop when using 'Modify with Editor' without a configured editor.
- Implements interactive editor selection via a UI dialog.
- Returns to the previous confirmation prompt if selection is cancelled or fails.
- Simplifies editor availability logic and removes deprecated sync functions.

Fixes #7669
2026-02-04 14:00:08 -05:00
Philippe
0ead53b095 Merge branch 'main' into fix/modify-with-external-editor-infinite-loop-7669 2026-02-01 21:03:25 +01:00
Philippe Granger
a526c76191 refactor(editor): use async functions to avoid blocking event loop
Replace synchronous execSync calls with async alternatives in editor
detection functions to prevent blocking the Node.js event loop.

Changes:
- Add commandExistsAsync using promisified exec
- Add checkHasEditorTypeAsync, isEditorAvailableAsync,
  detectFirstAvailableEditorAsync, and resolveEditorAsync
- Update confirmation.ts and coreToolScheduler.ts to use
  resolveEditorAsync
- Mark synchronous resolveEditor as deprecated
- Add comprehensive tests for all async functions

The synchronous versions are kept for UI components that require
synchronous execution (useEditorSettings, editorSettingsManager).
2026-01-24 19:58:50 +01:00
BaeSeokJae
0b7d26c9e3 fix(core): add alternative command names for Antigravity editor detec… (#16829)
Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
2026-01-23 15:56:39 +00:00
Philippe Granger
c904f4cece fix: resolve infinite loop when using 'Modify with external editor' (#7669)
This fix addresses the infinite loop issue reported in #7669 where selecting
"Modify with external editor" would loop indefinitely when no editor was
configured or available.

Root cause: When getPreferredEditor() returned undefined, the code silently
returned without changing the outcome, causing the while loop to repeat.

Changes:
- Add detectFirstAvailableEditor() to auto-detect available editors
- Add resolveEditor() to handle editor resolution with proper error messages
- Update confirmation.ts to break the loop and show error when editor unavailable
- Update coreToolScheduler.ts to cancel operation with feedback when editor unavailable
- Add 11 new tests for the new editor resolution functions

The fix:
1. Properly validates editor availability before attempting to use it
2. Auto-detects an available editor if none is configured
3. Provides clear error messages explaining why the editor cannot be used
4. Breaks the loop gracefully instead of looping infinitely
2026-01-22 21:25:40 +01:00
Gal Zahavi
45d554ae2f fix(core,cli): enable recursive directory access for (#17094) 2026-01-21 17:58:23 +00:00
Abhi
16da6918cb refactor(core): extract ToolModificationHandler from scheduler (#16118) 2026-01-08 19:52:56 +00:00
Kevin Jiang
982eee63b6 Hx support (#16032) 2026-01-07 02:31:38 +00:00
Jacob Richman
d1e35f8660 Protect stdout and stderr so JavaScript code can't accidentally write to stdout corrupting ink rendering (#13247)
Bypassing rules as link checker failure is spurious.
2025-11-20 10:44:02 -08:00
Shreya Keshive
86828bb561 feat: launch Gemini 3 in Gemini CLI 🚀🚀🚀 (in main) (#13287)
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com>
Co-authored-by: Sehoon Shon <sshon@google.com>
Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com>
Co-authored-by: Aishanee Shah <aishaneeshah@gmail.com>
Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: joshualitt <joshualitt@google.com>
Co-authored-by: Jenna Inouye <jinouye@google.com>
2025-11-18 09:01:16 -08:00
Gal Zahavi
741b57ed06 fix(core): Use shell for spawn on Windows (#9995) 2025-10-08 21:21:23 +00:00
Gal Zahavi
986b9fe7e9 refactor: Replace exec with spawn (#8510) 2025-09-16 19:03:17 +00:00
Pascal Birchler
ee4feea006 chore: consistently import node modules with prefix (#3013)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-08-25 20:11:27 +00:00
Ahmed Mughal
d35abdab99 fix(editors): fix neovim closing when using modify with editor (#5337)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2025-08-22 17:57:11 +00:00
Richie Foreman
2998f27f70 chore(compiler): Enable strict property access TS compiler flag. (#6255)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2025-08-17 16:43:21 +00:00
Gal Zahavi
aacae1de43 fix(core): prevent UI shift after vim edit (#5315) 2025-08-05 21:55:54 +00:00
Paige Bailey
37a3f1e6b6 Add emacs support, as per user requests. :) (#1633)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: matt korwel <matt.korwel@gmail.com>
Co-authored-by: matt korwel <mattkorwel@google.com>
2025-07-31 22:46:04 +00:00
Josh Soref
dc2ac144b7 Various spelling improvements (#3497)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
2025-07-21 21:54:44 +00:00
Cole Miller
7a9821607b Check for zeditor if zed binary is not found (#3680)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-07-20 19:35:21 +00:00
yuki yano
c860dac233 feat: add Neovim editor support (#1448) 2025-06-29 17:25:22 +00:00
Pyush Sinha
3518ff7663 feat: add VSCodium editor support (#2299)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
Co-authored-by: Allen Hutchison <adh@google.com>
2025-06-28 17:44:31 +00:00
cornmander
a2ed4266aa Update editor.ts (#1371) 2025-06-24 06:41:40 +00:00
Scott Densmore
324715ee8b Add Zed Editor to Eidtor List (#1372) 2025-06-23 23:32:09 -07:00
N. Taylor Mullen
197704c630 feat(test): Increase test coverage across CLI and Core packages (#1089) 2025-06-15 22:41:32 -07:00
Leo
1ef68e0612 feat: External editor settings (#882) 2025-06-11 18:21:54 -07:00
Eddie Santos
6484dc9008 Add Windsurf in edit tool to modify changes, if installed (#853) 2025-06-09 16:01:06 -07:00
matt korwel
3b943c1582 Windows: Refactor Shell Scripts to Node.js for Cross-Platform Compatibility (#784) 2025-06-09 12:19:42 -07:00
Eddie Santos
394312b9c2 Add tests for core/utils/editor (#851) 2025-06-08 19:42:42 +00:00