closedloop-technologies / autocomplete-sh

Large language model in the terminal! Less `--help` and `man` and more getting stuff done
MIT License
49 stars 3 forks source link

Feature Request: Adding recent outputs from the terminal into the prompt #1

Open closedLoop opened 5 months ago

closedLoop commented 5 months ago

For when you are debugging something in the terminal or you are executing a standard set of commands for which the errors or the outputs would be helpful in generating a good autocomplete.

It is my understanding that the main problem is that terminals do not have access to the values on the display as well stdout and stderr after the command is run.

Here is some good discussion regarding using PROMPT_COMMAND

This code in a .bashrc file will just set AC_RET to the exit code of the previous command. Not quite what's needed

function ac_prompt_command {
    AC_RET=$?
}
export PROMPT_COMMAND=ac_prompt_command

I could see a system when people use script command to log outputs. It could essentially capture the terminal behavior and provide it to the autocomplete operating within the script session.

I'm going to wait until I get more feedback on this.

closedLoop commented 4 months ago

This type of work will be moved to https://github.com/closedloop-technologies/justbuild

Merging this issue with #6 and only focusing on

get currently selected line contents or clipboard?