From e2d7bd5640ed62e1e36a59742f16a27dbbec38a7 Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Tue, 3 Jan 2017 12:46:47 -0500 Subject: [PATCH] [FIX] Enable SSH module for macOS Sierra Due to a change in macOS Sierra (10.12), reenabling the SSH module for Sierra (and presumably later versions) is advantageous. --- modules/ssh/README.md | 8 +++++--- modules/ssh/init.zsh | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ssh/README.md b/modules/ssh/README.md index 7324ae9a..6d2987d3 100644 --- a/modules/ssh/README.md +++ b/modules/ssh/README.md @@ -3,9 +3,11 @@ SSH Provides for an easier use of [SSH][1] by setting up [ssh-agent][2]. -This module is disabled on Mac OS X due to custom Apple SSH support rendering it -unnecessary. Use `ssh-add -K` to store identities in Keychain; they will be -added to `ssh-agent` automatically and persist between reboots. +This module is disabled on Mac OS X versions less than 10.12 (Sierra) due to +custom Apple SSH support rendering it unnecessary. Use `ssh-add -K` to store +identities in Keychain; they will be added to `ssh-agent` automatically and +persist between reboots. This support was removed in macOS Sierra to [re-align +behavior with mainstream OpenSSH](https://openradar.appspot.com/27348363). Settings -------- diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index f632328d..311bc5aa 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -6,7 +6,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" == darwin* ]] || (( ! $+commands[ssh-agent] )); then +if [[ `uname -s` == "Darwin" ]] && [[ `uname -r | awk -F. '{print $1}'` -le 15 ]] || (( ! $+commands[ssh-agent] )); then return 1 fi