sarugaku / shellingham

Tool to Detect Surrounding Shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would you be open to add other features to this library or is it to much outside the scope of this project?

frog-o opened this issue · comments

I like what you are doing, it seem a little plan though.

I always feel the point of putting things on GitHub is to find and work on things as a team and make a good program better ; however I often find people do not like traveling the direction i want to go.

I wanted to try to add a couple features to this library such as

1.)* the ability to launch a shell
2.)* the ability to add text to the shell (show a helpful messages)
3.)* the ability to add command to the shell (put a complete command on the terminal and all you have to do is push enter, kind of like tab completion)
4.)* the ability to read the shell command

Would any of these features be acceptable to your project?

To give you a better understanding of what these features would do and give you an example of there use. I thought I will give you Example session of a imaginary python program called git-helper( to help people learn to use git quicker) that used my purposed features . git-helper would first give you a list of common git task and help you complete each of those task on the shell. A common task like update a git repository could be made a lot easier.

You would type git-helper at the shell , it would then display list of common git task and a helpful massage

example secession

$git-helper

welcome to git-helper. Git helper is a tool that help write git command on the command line

here is a list of common git task

1.) clone a new repository
2.) update get repository
3.) commit changes
4.)etc.
which do you want to do.

you would type some like 1 and press enter(I going to pretend you enter 1 from the menu to show feature 1 from my list)

I going to launch you preferred shell and give you an example commands to help you complete this task.

you could then monitor thing like which directory the git-helper was launch in and if found not be in a git repository for example
then display a message (feature 2 and 3 from my list)

First you have to be in a repository here is the command to do that make appropriate changes

$ cd ~/src/git

  • and by using features 4 from my list i could offer suggestion as you type commands.

I know of a couple of methods of doing this.

1.) Fork this code but i need permission from you to do this.
2.) Create my own library and add your library as dependency
3*.) Add to this library only can be done if you want the changes.

I would preferred to use method 3 ;however such a change might be to far outside the scope of this project and might have to go with method 2.
What do you think?

Thank you for any commit.

Please note I don't have much for time and probably won't be able to implement any of this but still would love to know your
though on the best way to implement such features. I have done a lot of reading on ptty and find it very confusing yet since it is obvious that you spent a lot of time on working with the shell I was hope you would have some useful pointers.

All of those sound like useful features, but are IMO unrelated to this library. They all require the Python code to have some kind of knowledge to the currently running shell, but shell detection is entirely about looking for a shell-like executable in the current environment, using methods for various operating systems, and does not need to actually understand how the detected shell works. So I believe it is better to implement the proposed features in a separate library that accepts the shell name as a parameter, so you can feed whatever Shellingham detects into it. Those features do not even need to declare Shellingham as a dependency.