gfargo / coco

AI-powered Git Assistant for CLI
https://git-co.co/
MIT License
7 stars 0 forks source link

Config option to change what editor is used by `@inquirer/editor` #11

Closed gfargo closed 3 weeks ago

gfargo commented 1 year ago

From the docs, when using the editor prompt from @inquirer package:

Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)

This is complete when:

... could also take a look at using the postfix option inside of our editor calls:

postfix string no (default to .txt) The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.

Resources:

gfargo commented 1 year ago

Currently, it appears there's an issue when trying to use code as the editor.

Mentioned the behavior in https://github.com/SBoudrias/Inquirer.js/issues/1155. Will continue to investigate a solution or workaround for being able to edit contents within code instead of a terminal editor.

gfargo commented 3 weeks ago

Fix is outlined in this comment

export EDITOR='code -w'