From 1288d9e542face18dc7f74ada9b9d21186656357 Mon Sep 17 00:00:00 2001 From: Stanislav N Date: Sun, 15 Jan 2017 16:55:38 +0500 Subject: [PATCH] FreeBSD's mc without subshell alias and silenced gitinfo. Added alias for FreeBSD for mc launch as normal user, which may lack PTY access. Related to #6. Silenced gitinfo's errors on just-inited repo. Fixes #3. --- zsh/aliases/20-freebsd.conf | 3 +++ zsh/apps/gitinfo.app.zsh | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zsh/aliases/20-freebsd.conf b/zsh/aliases/20-freebsd.conf index b06fb68..6d97ab6 100644 --- a/zsh/aliases/20-freebsd.conf +++ b/zsh/aliases/20-freebsd.conf @@ -3,4 +3,7 @@ if [ "${OS/FreeBSD}" != "${OS}" ]; then # Files navigation. alias ls="ls -G" + # mc having troubles with subshells and normal users accounts. + # Force an alias that will launch mc without subshell capabilities. + alias mc="mc -u" fi \ No newline at end of file diff --git a/zsh/apps/gitinfo.app.zsh b/zsh/apps/gitinfo.app.zsh index 083f5e0..2375981 100644 --- a/zsh/apps/gitinfo.app.zsh +++ b/zsh/apps/gitinfo.app.zsh @@ -103,9 +103,9 @@ function gitinfo_get_changes() ###################################################################### function gitinfo_get_commit_data() { - GITINFO_COMMIT_SHORTID=`git rev-parse --short HEAD | sed "s/ //g"` - GITINFO_COMMIT_ID=`git log | head -n 1 | cut -d " " -f 2 | sed "s/ //g"` - GITINFO_COMMIT_COUNT=`git log | grep "commit " | wc -l | sed "s/ //g"` + GITINFO_COMMIT_SHORTID=`git rev-parse --short HEAD 2>/dev/null | sed "s/ //g"` + GITINFO_COMMIT_ID=`git log 2>/dev/null | head -n 1 | cut -d " " -f 2 | sed "s/ //g"` + GITINFO_COMMIT_COUNT=`git log 2>/dev/null | grep "commit " | wc -l | sed "s/ //g"` } ######################################################################