Comments (3)
There are many cases when it's hard to detect which shell the program is running under like in Unix-like environments on Windows, none-interactive shells, SHELL variable is not set correctly, etc. As for checking for the basename, I am not even sure that it would work on Windows (anyway, better to use os.path.basename because it takes into account OS path name conventions).
There is also a case of none-interactive installs when the current shell name is irrelevant. I think it would be better to implement an argument to --install-integration
option to specify the indented shell, e.g., --install-integration [bash|zsh]
. Then if the argument is omitted try to guess the shell. shellingham does a good job of poking around to guess the shell but other solution are also possible.
from shell_gpt.
Properly detecting shell can be tricky. The best option is to use a dedicated package like shellingham. I did it in my fork but cannot pass the tests: https://github.com/sorokine/shell_gpt
from shell_gpt.
Couldn't it just check for the basename? i.e.
if shell.split("/")[-1] == "zsh":
and
elif shell.split("/")[-1] == "bash":
This would allow for it to work with zsh or bash regardless of where it is installed, and unless I'm mistaken the capability of the integrations doesn't depend on the path of the shell binary, it just has to be zsh or bash.
from shell_gpt.
Related Issues (20)
- Implement Ctrl-C (SIGINT) Handling for Graceful Interruption of Streaming
- Potential Bug Report: ModuleNotFoundError for 'pkg_resources' with pipx HOT 1
- Importing litellm is slow HOT 1
- Function Calling: unexpected behavior within ShellGPT's REPL mode when using the --repl --shell options HOT 3
- Feature request: math formatting HOT 1
- --chat and --role options does'nt seem to work together with any other prompt than default HOT 2
- Error: ShellGPT integrations only available for ZSH and Bash. HOT 2
- Documentation could be clearer for Docker
- `sgpt --show-role code` errors out (see description for error message) HOT 1
- Edit commands from `sgpt -s` mode . . .
- multiple script edition/creation
- Add convenience cli options for displaying config path and folder
- Pasting from clipboard into --repl mode does not handle new line characters HOT 1
- Error code: 404 - The model `gpt-4-1106-preview` does not exist or you do not have access to it.
- when use ollama that completion can't work HOT 1
- Want to add the ability to translate local files directly HOT 3
- Dependency error in Python 3.8: instructor
- Is it possible to support gemini api HOT 4
- 能加入 语音聊天功能吗?
- Missing instructions to run on Azure HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shell_gpt.