From 45aeb86c219d121f0fdd819040c17e277e1fb93a Mon Sep 17 00:00:00 2001 From: John D Pell Date: Thu, 30 Dec 2021 12:38:52 -0800 Subject: [PATCH] plugin/osx-timemachine: abuse `$SUDO_COMMAND` Use `$SUDO_COMMAND` as a back-channel to `ssh-askpass` to set a reasonable title if it pops up. --- plugins/available/osx-timemachine.plugin.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/available/osx-timemachine.plugin.bash b/plugins/available/osx-timemachine.plugin.bash index 2eef14bd..e30d37bd 100644 --- a/plugins/available/osx-timemachine.plugin.bash +++ b/plugins/available/osx-timemachine.plugin.bash @@ -60,7 +60,8 @@ function time-machine-list-old-backups() { # Taken from here: http://stackoverflow.com/a/30547074/1228454 function _tm_startsudo() { - sudo -v # validate without running a command. + local -x SUDO_COMMAND="plugin/osx-timemachine: keep 'sudo' token alive during long-run 'tmutil' commands" + sudo "-${SUDO_ASKPASS:+A}v" # validate without running a command, using `ssh-askpass` if available. (while sudo "-${SUDO_ASKPASS:+A}v"; do sleep 50 done) &