Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed reattached screen sessions not seeing the new SSH_AUTH_SOCK
- Loading branch information
Showing
4 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
if [[ -n "$SSH_CONNECTION" ]] && (($+commands[screen])); then | ||
if [[ -n "$SSH_AUTH_SOCK" ]]; then | ||
verbose Symlinking $fg[yellow]$SSH_AUTH_SOCK$reset_color to $fg[yellow]/tmp/ssh-agent-$USER-screen$reset_color | ||
ln -sf "$SSH_AUTH_SOCK" "/tmp/ssh-agent-$USER-screen" | ||
fi | ||
|
||
verbose Starting $fg[green]screen$reset_color because we\'re connected using $fg[green]ssh$reset_color | ||
/usr/bin/screen -dRq ssh && exit | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters