<div dir="ltr">Here's a new patch (that replaces the previous one) that fixes quoting in the `write_to_clipboard` function:<div><br></div><div><div>---</div><div> src/platform/linux.sh | 29 +++++++++++++++++++++++++++++</div><div> 1 file changed, 29 insertions(+)</div><div> create mode 100644 src/platform/linux.sh</div><div><br></div><div>diff --git a/src/platform/linux.sh b/src/platform/linux.sh</div><div>new file mode 100644</div><div>index 0000000..ea899f2</div><div>--- /dev/null</div><div>+++ b/src/platform/linux.sh</div><div>@@ -0,0 +1,29 @@</div><div>+# This file is actually for Bash on Ubuntu on Windows!</div><div>+</div><div>+clip() {</div><div>+<span style="white-space:pre"> </span>local sleep_argv0="password store sleep on display $DISPLAY"</div><div>+<span style="white-space:pre">       </span>pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5</div><div>+<span style="white-space:pre">       </span>local before="$(read_from_clipboard | base64)"</div><div>+</div><div>+    write_to_clipboard "$(echo -n "$1")"</div><div>+<span style="white-space:pre">       </span>(</div><div>+<span style="white-space:pre">            </span>( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )</div><div>+<span style="white-space:pre">            </span>local now="$(read_from_clipboard | base64)"</div><div>+</div><div>+<span style="white-space:pre">                </span>[[ $now != $(echo "$1" | base64) ]] && before="$now"</div><div>+        write_to_clipboard "$(echo "$before" | base64 -d)"</div><div>+<span style="white-space:pre">   </span>) 2>/dev/null & disown</div><div>+<span style="white-space:pre">        </span>echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."</div><div>+}</div><div>+</div><div>+read_from_clipboard() {</div><div>+    local text="$(/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::GetText()")"</div><div>+    # Remove trailing carriage return:</div><div>+    echo "${text:0:-1}"</div><div>+}</div><div>+</div><div>+write_to_clipboard() {</div><div>+    # Escape for PowerShell:</div><div>+    local text="${1//\'/\'\'}"</div><div>+    /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::SetText('$text')"</div><div>+}</div><div>-- </div><div>2.10.0.windows.1</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 10:47 AM, Kenny Evitt <span dir="ltr"><<a href="mailto:kenny.evitt@gmail.com" target="_blank">kenny.evitt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I didn't submit a patch because I don't expect it be to merged upstream anytime soon. The 'soft fork' is just a convenient place for me to keep the changes where I, and anyone else, can access them.<div><br></div><div>Here's the patch for the changes (excluding my "soft fork" README changes):</div><div><br></div><div><div>---</div><div> src/platform/linux.sh | 27 +++++++++++++++++++++++++++</div><div> 1 file changed, 27 insertions(+)</div><div> create mode 100644 src/platform/linux.sh</div><div><br></div><div>diff --git a/src/platform/linux.sh b/src/platform/linux.sh</div><div>new file mode 100644</div><div>index 0000000..93c568e</div><div>--- /dev/null</div><div>+++ b/src/platform/linux.sh</div><div>@@ -0,0 +1,27 @@</div><div>+# This file is actually for Bash on Ubuntu on Windows!</div><div>+</div><div>+clip() {</div><div>+<span style="white-space:pre-wrap">        </span>local sleep_argv0="password store sleep on display $DISPLAY"</div><div>+<span style="white-space:pre-wrap">  </span>pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5</div><div>+<span style="white-space:pre-wrap">  </span>local before="$(read_from_clipboard | base64)"</div><div>+</div><div>+    write_to_clipboard "$(echo -n "$1")"</div><div>+<span style="white-space:pre-wrap">  </span>(</div><div>+<span style="white-space:pre-wrap">               </span>( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )</div><div>+<span style="white-space:pre-wrap">               </span>local now="$(read_from_clipboard | base64)"</div><div>+</div><div>+<span style="white-space:pre-wrap">           </span>[[ $now != $(echo "$1" | base64) ]] && before="$now"</div><div>+        write_to_clipboard "$(echo "$before" | base64 -d)"</div><div>+<span style="white-space:pre-wrap">      </span>) 2>/dev/null & disown</div><div>+<span style="white-space:pre-wrap">   </span>echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."</div><div>+}</div><div>+</div><div>+read_from_clipboard() {</div><div>+    local text="$(/mnt/c/Windows/<wbr>System32/WindowsPowerShell/v1.<wbr>0/powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.<wbr>Clipboard]::GetText()")"</div><div>+    # Remove trailing carriage return:</div><div>+    echo "${text:0:-1}"</div><div>+}</div><div>+</div><div>+write_to_clipboard() {</div><div>+    /mnt/c/Windows/System32/<wbr>WindowsPowerShell/v1.0/<wbr>powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.<wbr>Clipboard]::SetText(\"$1\")"</div><div>+}</div><span class="HOEnZb"><font color="#888888"><div>-- </div><div>2.10.0.windows.1</div></font></span></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 4, 2018 at 11:14 AM, Jason A. Donenfeld <span dir="ltr"><<a href="mailto:Jason@zx2c4.com" target="_blank">Jason@zx2c4.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Instead of a "soft fork", why not just submit proper patches to the<br>
mailing list to be reviewed and merged upstream? git-send-email is<br>
your friend.<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>