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

--clip should default to --password if no option is given #58

Closed
rothgar opened this issue Nov 12, 2014 · 7 comments
Closed

--clip should default to --password if no option is given #58

rothgar opened this issue Nov 12, 2014 · 7 comments

Comments

@rothgar
Copy link

rothgar commented Nov 12, 2014

By default if you use lpass show --clip example you will get all of the contents of the site in the following structure copied to your clipboard.

example/example [id: 0000000000]
Username: admin
Password: password
URL: https://example.com/

That is fairly useless in a copy/paste form and is redundant with the --all option. It would be better if --password was the default because that is usually the sensitive value being stored in a password manager.

It would also be helpful if there could be shortened version of --username and --password (-u and -p) to save with typing when copy/pasting the most often used values.

@bcopeland
Copy link
Contributor

I don't really agree with changing the default, for consistency of interface reasons.

But sure, short options makes a lot of sense, just pushed that.

@rothgar
Copy link
Author

rothgar commented Nov 13, 2014

@bcopeland Can you please explain "consistency of interface reasons."

My reasoning is from experience using LastPass browser plugins and pass. In LastPass the username/password are the main values for autofill and have shortcuts in the UI to copy them. In pass -c copies the first line of the gpg encrypted file (which could be anything) but defaults to the password for the entry.

Having -c copy the entire entry is useless to paste into a form/app/webpage because there is extra metadata and possible notes that will get mangled when pasting and need to be deleted. Thus to make -c useful you have to specify at least one extra option.

Maybe a compromise would be a setting to allow setting the default copy field/flag.

On a side note, entries are not cleared from the clipboard after a set amount of time. I'll open a new issue for that though.

@bcopeland
Copy link
Contributor

Consistency meaning adding "-c" doesn't change the set of data that is selected. I agree that the user probably never wants to copy all when they do -c, but if we default to all at least the data is the same with and without '-c'. Also some items like secure notes won't have a password.

With the suggested short character change, it's the difference of one character so I don't think it's that onerous (also you could of course define a shell alias like alias lp="lpass show -cp" if that's your most common usage).

@bcopeland
Copy link
Contributor

RE clearing the clipboard... lpass isn't running any longer after it is copied, so I'm not sure how we might technically achieve that.

@rothgar
Copy link
Author

rothgar commented Nov 13, 2014

Not sure about all platforms but for Linux you could run something like at now + 1 minute <<< "echo clear | xclip -selection c" after copy. exact syntax is probably wrong.

You could also see the function pass makes in bash to clear the clipboard after 45 seconds using exec, sleep, and disown. Again, not super useful cross platform, but doable.

@bcopeland
Copy link
Contributor

Yes, I suppose we can fork a new process that just does sleep(x); exec(xclip)... Please do open an issue for that.

@rothgar
Copy link
Author

rothgar commented Nov 13, 2014

Will do. Thanks for the feedback. I'll go the alias route for defaulting -c to --password

@rothgar rothgar closed this as completed Nov 13, 2014
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