On 04/27/2014 02:32 PM, Jason A. Donenfeld wrote:
When we use the clipboard here's what happens:

1. The contents of the current clipboard is put in a temporary
variable for being restored 45 seconds later.
2. The first line of the desired file, or the newly generated
password, is copied to the clipboard, with no trailing newline.

Bash makes (1) very hard because it doesn't allow storing variables
with null characters, and makes it unnecessarily verbose for
remembering if the output of a command did or did not have a trailing
newline. For this reason, we instead treat the contents of the current
clipboard in (1) as generic binary data. As such, we store it
temporarily in base64 to work around bash's restrictions.

Hi Jason,

Thanks for responding. So if I understand correctly, the current "base64" implementation will preserve any newlines when copying and restoring the previous contents of the clipboard. However, replacing the "base64" or "base64 -d" command with "tr -d '\n' " will remove any newlines when restoring the previous contents to the clipboard, so the functionality is not exactly the same.

Still, I noticed that a month ago on the mailing list some people expressed interest in simplifying the clip() function by just emptying the clipboard after 45 seconds. Doing this would remove the "base64" dependency in cygwin/mingw/msys/msysgit. Do you have any thoughts on this?

P.S. Do you have a preference about top-posting or bottom-posting email replies on the listserv?

Thanks,
--Stephen Stephen

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to