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

Terminal parsing #11

Open
lrozema opened this issue Jan 26, 2015 · 4 comments
Open

Terminal parsing #11

lrozema opened this issue Jan 26, 2015 · 4 comments

Comments

@lrozema
Copy link

lrozema commented Jan 26, 2015

Is it possible to parse a piece of the terminal (last line for instance) to determine which account to load? And is it possible to chat the password directly from 1pw into the terminal?

For instance I sometimes SSH into a remote server and want to do a git pull one of my private Github repos. I would like to:

me@myserver:~/folder$ git pull
Username for 'https://github.com':

And then hit cmd-\ and then have it show my Github web entry. Then when I choose it that it first enters the username and then the password, preferably depending on what the terminal asks.

Maybe in the beginning this could simply be depending on a few chat script like fields inside the different accounts. For instance by setting 'match_login' as 'git pull', 'match_user' as' Username for 'https://github.com':', etc.. Then it could chat with the terminal directly after I hit cmd-\ and choose the account that I want to use?

@ravenac95
Copy link
Owner

@lrozema So sorry I didn't respond sooner! That's something I've wanted to experiment with but haven't had time to as of late. I will definitely see if we can do something here.

@thorhs
Copy link

thorhs commented Jun 28, 2017

This could probably be handled by allowing a username to be specified on the command line when starting the co-process. iTerm triggers could then be used instead of a keypress to start the coprocess. The coprocess could then send the DEFAULT_HOSTNAME string, but with the username included. The triggers can pass in data that is gathered from a regular expression.

@lrosenstein
Copy link

That's exactly what I do and it works well. The change I made to make this possible is here: lrosenstein@fb36f08

@thorhs
Copy link

thorhs commented Jun 30, 2017

Not bad. What I've wanted to do is to have the option of specifying a user and host, if a user is specified, use:
sudolikeaboss://@Local
and if user and host is specified use:
sudolikeaboss://@

Then, hopefully be able to configure a trigger that grabs the username and possibly hostname from the sudo command. I could then configure the sudo prompt to include username and hostname on all my hosts. The regular expression could then send just the username if I'm on a kerberos/ad connected server, or the username and hostname if not.

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

4 participants