From 1acf8bc005db92e071b0c07e3e48aa8b6adf3737 Mon Sep 17 00:00:00 2001 From: Jorge Morante Date: Thu, 8 Nov 2018 09:27:53 +0100 Subject: [PATCH] remove health-check from startup --- README.md | 8 ++++++++ docs/health-check.md | 14 +++++--------- scripts/health-check.sh | 13 +------------ tmux-fingers.tmux | 1 - 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index e7108a6..214923b 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,14 @@ Custom format for the highlighted match. See [@fingers-hint-format](#fingers-hin Same as above, used when `@fingers-compact-hints` is set to `0`. +# Troubleshooting + +If you encounter any problems you can run the following command to automatically detect common problems: + +` $ /path/to/tmux-fingers/scripts/health-check.sh` + +More info in [health-check.md](./docs/health-check.md) + # Acknowledgements and inspiration This plugin is heavily inspired by diff --git a/docs/health-check.md b/docs/health-check.md index d9b96ec..695eb92 100644 --- a/docs/health-check.md +++ b/docs/health-check.md @@ -1,9 +1,13 @@ # Health check troubleshooting -*tmux-fingers* performs a health check on startup to ensure that your system has all dependencies needed to run smoothly. +`health-check.sh` performs a checks to ensure that your system has all dependencies needed to run smoothly. They are not much, and in most GNU/linux environments these are the defaults anyway. +To run the check you need to run the following command. + +`$ /path/to/tmux-fingers/scripts/health-check.sh` + ## gawk not found Install `gawk` package. @@ -27,14 +31,6 @@ This probably means you are running OSX, which ships with *bash 3*. In order to You can install latest *tmux* from source, check https://github.com/tmux/tmux -## How to skip the check - -If can't skip this check by adding the following in your .tmux.conf file: - -``` -set -g @fingers-skip-health-check '1' -``` - ## Wrong $TERM value Tmux fingers works better with proper 256 support. Set `@default-terminal` to either `screen-256color` or `xterm-256color`. diff --git a/scripts/health-check.sh b/scripts/health-check.sh index dacc588..4bf84d5 100755 --- a/scripts/health-check.sh +++ b/scripts/health-check.sh @@ -118,12 +118,6 @@ function perform_health_check() { GAWK_VERSION=$(gawk -W version | grep -Eo "[0-9]+\.[0-9]\.[0-9]" | head -n 1) fi - FINGERS_SKIP_HEALTH_CHECK=$(tmux show-option -gqv @fingers-skip-health-check) - - if [[ $FINGERS_SKIP_HEALTH_CHECK -eq 1 ]]; then - return - fi - if [[ $(program_exists "gawk") = 0 ]]; then log_message " * 'gawk' not found" healthy=0 @@ -191,8 +185,6 @@ function perform_health_check() { log_message "" log_message " $HELP_LINK" log_message "" - log_message "To skip this check add \"set -g @fingers-skip-health-check '1'\" to your tmux conf" - log_message "" dump_log @@ -200,10 +192,7 @@ function perform_health_check() { : # waiting for-tmux done - local health_window_id=$(tmux new-window -P -n "[tmux-fingers health-check]" "tmux wait-for -S health_output && cat $health_tmp | less") - tmux wait-for health_output - tmux split-window -t "$health_window_id" -v -l 15 -c "$TMUX_FINGERS_ROOT" - tmux select-window -t "$health_window_id" + cat $health_tmp fi sleep 0.5 diff --git a/tmux-fingers.tmux b/tmux-fingers.tmux index 85c70d0..db017a5 100755 --- a/tmux-fingers.tmux +++ b/tmux-fingers.tmux @@ -2,7 +2,6 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -tmux run -b "$CURRENT_DIR/scripts/health-check.sh" tmux run -b "bash --norc --noprofile $CURRENT_DIR/scripts/config.sh" DEFAULT_FINGERS_KEY="F"