Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Leave suggestions in terminal when I ctrl-c #12

Open
romilbhardwaj opened this issue Jul 14, 2023 · 1 comment
Open

[UX] Leave suggestions in terminal when I ctrl-c #12

romilbhardwaj opened this issue Jul 14, 2023 · 1 comment

Comments

@romilbhardwaj
Copy link

Great project! Two UX suggestions when I ctrl-c after suggestions are shown:

  1. Leave the suggestions in terminal instead of erasing them, so I refer back to them
  2. Remove the scary traceback when I ctrl-c :)
(base) ➜  ~ gorilla gcloud change project
🦍  Welcome to Gorilla. Use arrows to select

Cancelled by user

Traceback (most recent call last):
  File "/Users/romilb/tools/anaconda3/bin/gorilla", line 8, in <module>
    sys.exit(main())
  File "/Users/romilb/tools/anaconda3/lib/python3.9/site-packages/go_cli.py", line 155, in main
    exit_condition = execute_command(selected_command)
  File "/Users/romilb/tools/anaconda3/lib/python3.9/site-packages/go_cli.py", line 119, in execute_command
    process = subprocess.run(cmd, shell=True, stderr=subprocess.PIPE)
  File "/Users/romilb/tools/anaconda3/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/romilb/tools/anaconda3/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/romilb/tools/anaconda3/lib/python3.9/subprocess.py", line 1680, in _execute_child
    args = list(args)
TypeError: 'NoneType' object is not iterable
@ShishirPatil
Copy link
Member

ShishirPatil commented Jul 18, 2023

These are great suggestions @romilbhardwaj 💯 Will include them in the next release 🚀 Open source contributions welcome and I'd be happy to merge a PR on this!

ShishirPatil added a commit that referenced this issue Oct 19, 2023
- [X] Append command to user bash history and prefill shell. Even though
we can append command to bash history, it does not show up in the
reverse-i-search without sourcing the shell. This is because the child
process cannot modify the environment of the parent caller process
[stack-overflow
reference](https://stackoverflow.com/questions/3661566/python-source-home-bashrc-with-os-system).
So, instead will will pre-fill the shell command with the selected
command.
- [X] Get OS environment
- [X] Refactor unique ID generation - mostly cosmetic 
- [x] Update server to route LLM based on os environment
- [x] Test on Ubuntu Linux
- [x] Test on Darwin (Mac OS)
- [ ] Test on WSL
- [ ] Test on Windows Powershell

Thoughts, suggestions, and reviews welcome!

Relevant to #39 and #12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants