PowerShell / ProjectMercury

An interactive shell to work with AI-powered assistance providers
MIT License
52 stars 13 forks source link

Enable empty input prediction and make list view support smaller width #193

Closed daxian-dbw closed 3 months ago

daxian-dbw commented 3 months ago

PR Summary

This PR is the preparation work to support the parameter injection scenario.

  1. Update the prediction to support empty-string input, and enable prediction fresh into the ReadLine call, before user pressing any keystroke.
    • Update ForceRender to be able to cancel rendering when it's okay to do so.
  2. Update the list view to support smaller terminal width (MinWindowWidth = 30), and stop rendering the source part in list items when the terminal width is < 50.
  3. Fix the prompt when user press Ctrl+c within ReadLine call.
  4. Add the /replace to validate the changes for the parameter injection scenario. This command is temporary and will be replaced later.
    • I will provide a utility API to assist the argument replacement, then an agent can decide if it want to expose a command to support the argument replacement. The az-cli agent will expose such a command, probably named as /edit.