Menu

#32 Add command to copy password to clipboard and clear it automatically

v1.0 (example)
closed-fixed
None
9
2016-10-02
2016-09-25
No

Please add command (eg 'xpx') to copy the password to clipboard (like 'xp') and clear clipboard (like 'xx') after 10 seconds (if the password is still in clipboard).

Thanks.

Discussion

  • Lester Hightower

    • status: open --> closed-wont-fix
    • assigned_to: Lester Hightower
     
  • Lester Hightower

    This is a real technical challenge due to the fact that Term::ShellUI has control of the process until commands are issued, and Term::ShellUI has no facility for timed calls or interupts. I'd be willing to consider some else's patch for this, preferably in the form of an enhancement to Term::ShellUI, but I am not willing to code it at this time.

     
  • Lester Hightower

    I gave this a bit more thought and decided to do it and so the xpx command will be in the next release. It does cause kpcli to not be interactive with the user for the 10 second countdown, but the feature is now in. Example of how it works:

    kpcli-DEVELOPMENT:/> xpx eMail/foo
    Copied password for "foo" to the clipboard.
    Clipboard will be cleared in 0 seconds...
    Clipboard cleared.
    kpcli-DEVELOPMENT:/> 
    
     
  • Lester Hightower

    • status: closed-wont-fix --> closed-fixed
    • Priority: 5 --> 9
     
  • Hannes von Haugwitz

    Many thanks.

     
  • Hannes von Haugwitz

    Where can I find the patch for this feature, so I can use/test it? Is there no VCS for kpcli?

     
  • Lester Hightower

    Here is the diff:

    $ diff kpcli-3.1.pl kpcli-DEVELOPMENT.pl
    113c113
    < my $VERSION = "3.1";
    ---
    > my $VERSION = "DEVELOPMENT";
    335a336,341
    >          "xpx" => {
    >              desc => "Copy password to clipboard, with auto-clear: xpx <entry path|number>",
    >              minargs => 1, maxargs => 1,
    >              args => \&complete_groups_and_entries,
    >              method => sub { cli_xN('xpx', @_); }
    >          },
    1720c1726
    <     $xNcmd eq 'xp' && do {
    ---
    >     $xNcmd =~ m/^xpx?$/ && do {
    1731a1738
    >       'xpx' => 'password',
    1737a1745,1761
    >   # The user has asked us to auto-clear the clipboard
    >   if ($xNcmd eq 'xpx') {
    >     for my $n (reverse (0..9)) {
    >       for my $i (reverse (0..9)) {
    >         if (($i > 0 || $n == 0) && !($i % 3)) {
    >           print "\rClipboard will be cleared in $n.$i seconds...";
    >         }
    >         if (recent_sigint()) { print "\n"; return undef; } # Bail on SIGINT
    >         Time::HiRes::sleep(0.1);
    >       }
    >     }
    >     print "\n";
    >     Clipboard->copy('');
    >     print "Clipboard cleared.\n";
    >     return;
    >   }
    > 
    5446a5471
    >  2016-xxx-xx v3.2 - Added xpx command per the request in SF ticket #32.
    
     

Log in to post a comment.