Git Product home page Git Product logo

Comments (9)

hazcod avatar hazcod commented on August 24, 2024 4

@tomprince: hmm, export LPASS_CLIPBOARD_COMMAND="xclip -l 1" does not seem to copy anything to the clipboard.

export LPASS_CLIPBOARD_COMMAND="xclip -selection clipboard -in -l 1" does the job.

from lastpass-cli.

kozmic avatar kozmic commented on August 24, 2024 2

For macOS there seems to be no solution... this is the best workaround I've come up with that will clear the clipboard after X seconds, and you still get bash/zsh autocompletion:

$ cat ~/bin/pbclear
#!/bin/bash
if [ -n "$1" ]; then
  sleep $1
fi
echo -n '' | pbcopy
$ alias lps
lps='~/bin/pbclear 4 &; lpass show -c --password '

I think clearing clipboard after X seconds of population is a core feature of a password manager (like 1Password has this built in). But the way lastpass-cli has implemented populating clipboard (basically execute all clipboard managers and see which one that succeeds) makes this hard to implement in lastpass-cli.

from lastpass-cli.

wkoszek avatar wkoszek commented on August 24, 2024 1

@cspeterson @bcopeland I can see why people want that, but looks there are workarounds to get this functionality without changing the core program. It's good to keep lastpass-cli to minimum. Let's just close this issue.

from lastpass-cli.

hazcod avatar hazcod commented on August 24, 2024

I would like this too. Sadly, I do not have any knowledge of C but I will take a look at the code.

from lastpass-cli.

stuartcryan avatar stuartcryan commented on August 24, 2024

+1 I would love to see this.

from lastpass-cli.

tomprince avatar tomprince commented on August 24, 2024

This would be a good thing to support, as a workaround, you can now set LPASS_CLIPBOARD_COMMAND to something that does what you want. (I have it set to xclip -l)

from lastpass-cli.

cspeterson avatar cspeterson commented on August 24, 2024

I investigated whether a consistent, reasonable, secure default solution was possible across the four different supported clipboard tools so I could just submit a pull request, but: nope!

The tools:
xclip (Linux), xsel (Linux), pbcopy (MacOS), putclip (cygwin)

  • xclip: as pointed out above, can be told to limit the number of subsequent paste requests, but cannot set a timeout/expiration
  • xsel: can specify a timeout in ms, but not a limit on paste requests
  • pbcopy: offers no such functionality
  • putclip: what is this even? I'm unable to find a manpage or anything

Anyway, the bottom line is that the different supported clipboard interfaces even on the same platform do not support consistent behaviour. I think the environment variables remain the best solution. :(

from lastpass-cli.

hazcod avatar hazcod commented on August 24, 2024

@kozmic did you see my comment above? xclip is available on brew.

from lastpass-cli.

kozmic avatar kozmic commented on August 24, 2024

@hazcod I did see it, but xclip uses another buffer for data (correct me if I'm wrong), so I can't paste my password into applications with Command+V.

from lastpass-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.