You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In bash (I haven't checked other shells, so it might be happening in other environments) when pressing ctrl-g the plugin automatically searches and suggests a command to run, without replacing the original text.
If the original text doesn't start with #, ie it's not a comment, when the user hits enter, the shell executes both the NL sentence and the suggested command, leading to unexpected errors and potential issues.
Example 1: expected user interaction:
Enter # what's the temperature in Oslo?
Press ctrl-g
Codex suggests curl wttr.in/Oslo
User hits Enter
Shell executes the suggested command without errors
Example 2: unexpected user interaction:
Enter what's the temperature in Oslo?
Press ctrl-g
Codex suggests curl wttr.in/Oslo
User hits Enter
The shell hangs waiting for the user to enter a single quote, and eventually throws an error
(note in this picture # is my shell prompt, not part of the input)
This happens because the original text is not replaced, so the shell executes both the user initial input and the suggested command. This could lead to very unexpected results depending on what the user sentence contains.
The text was updated successfully, but these errors were encountered:
perhaps when putting the original text back, the code could add a # prefix if missing
This is an interesting idea. The project currently does assume that the user will always model their input as a comment. That said, I'm sure many people will do what you did above - injecting a comment operator would make sense in that case.
In bash (I haven't checked other shells, so it might be happening in other environments) when pressing ctrl-g the plugin automatically searches and suggests a command to run, without replacing the original text.
If the original text doesn't start with
#
, ie it's not a comment, when the user hits enter, the shell executes both the NL sentence and the suggested command, leading to unexpected errors and potential issues.Example 1: expected user interaction:
# what's the temperature in Oslo?
curl wttr.in/Oslo
Example 2: unexpected user interaction:
what's the temperature in Oslo?
curl wttr.in/Oslo
(note in this picture
#
is my shell prompt, not part of the input)This happens because the original text is not replaced, so the shell executes both the user initial input and the suggested command. This could lead to very unexpected results depending on what the user sentence contains.
The text was updated successfully, but these errors were encountered: