Closed codehruv closed 2 years ago
@codehruv should we do this for all the shells (cmd, ps, bash, zsh) and update the docs?
What do you think about the scenario where there is no suggestion? e.g.
hello
Ctrl-G
# hello
and Codex doesn't suggest a command, so the user is left with a commented line+1 for keeping it consistent between shells.
@dluc in a separate PR, I have added code so that if the model doesn't return a response, we print a message like "# model didn't return a response"
@dluc I wasn't going to change the docs till the change was made for bash/zsh as well. Do you think it will be possible to modify the shell buffer in bash/zsh for similar behavior?
@dluc in a separate PR, I have added code so that if the model doesn't return a response, we print a message like "# model didn't return a response"
Personally I wouldn't replace the input with an error. A similar scenario I can think of is "autocompletion", where nothing happens. E.g. if you type python-he
and press Tab to autocomplete, nothing happens, and users are familiar with this behavior. If I pressed Tab and python-he
was replaced with an error message, it would feel very odd.
Also I think that mentioning "model" can be confusing, it's an internal implementation detail. If we want to show an error, I would leave the original text in place, echo the error, and move to a new empty prompt, something like:
C:\> # hello [user presses Ctrl-g]
Codex CLI could not find a suggestion
C:\>
Now we don't have to add
#
before every natural language command in powershell. It will be added automatically.