Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@busterc
Created September 1, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save busterc/f8e988b4ca63f24c71c56daf448a3de9 to your computer and use it in GitHub Desktop.
Save busterc/f8e988b4ca63f24c71c56daf448a3de9 to your computer and use it in GitHub Desktop.
[BAT_PAGER] prevent dumping output to screen on quit #bash #sh

BAT_PAGER

prevent dumping output to screen on quit

  1. Save bat_pager script to $HOME/bin
    #!/usr/bin/env bash
    less -r "$@"
  2. Make it executable:
    chmod +x $HOME/bin/bat_pager
  3. in $HOME/.bashrc
    if [[ -s "$HOME/bin/bat_pager" ]]; then
      export BAT_PAGER="$HOME/bin/bat_pager"
    fi
#!/usr/bin/env bash
less -r "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment