Skip to content

Commit

Permalink
plugin/osx-timemachine: abuse $SUDO_COMMAND
Browse files Browse the repository at this point in the history
Use `$SUDO_COMMAND` as a back-channel to `ssh-askpass` to set a reasonable title if it pops up.
  • Loading branch information
gaelicWizard committed Dec 31, 2021
1 parent 5a4fda2 commit 1efc412
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/available/osx-timemachine.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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) &
Expand Down

0 comments on commit 1efc412

Please sign in to comment.