Skip to content
Snippets Groups Projects
Commit ba780ef9 authored by syl20bnr's avatar syl20bnr
Browse files

Add Mac OS X compatibility for ranger feature of syl20bnr theme

parent 59ada029
Branches
No related merge requests found
......@@ -13,6 +13,7 @@ Sylvain Benner personal, compact (hmmm...) yet complete (almost :-)) oh-my-fish
- [end](#end)
- [where](#where)
- [Functions](#functions)
- [Mac compatibility](#mac-compatibility)
- [Cygwin compatibility](#cygwin-compatibility)
## Segments
......@@ -101,12 +102,18 @@ This segment is displayed in the right prompt.
Some functions come with the theme:
- `toggle_right_prompt` will... toggle the right prompt! (alias: `trp`)
## Mac compatibility
In order to make this theme work correctly with all the features make sure to
install the following packages via MacPorts or Homebrew:
-`pstree` (used in ranger detection)
## Cygwin compatibility
In order to make this theme work on [Cygwin][cygwin], make sure to install the following
packages:
- `bc` for `math` fish function
- `psmisc` for `pstree`
- `psmisc` for `pstree` (used in ranger detection)
- `git` if you want to use the `git` segment.
[git]: http://git-scm.com/
......
......@@ -166,8 +166,19 @@ function fish_prompt -d "Write out the left prompt of the syl20bnr theme"
# the current shell process and get back to the ranger process.
set -l ps_end ">"
# indicator for ranger parent process
set ranger ""
if pstree -p -l | grep "fish("(echo %self)")" | grep 'ranger([0-9]*)' > /dev/null
set -l ranger ""
set -l os (uname)
if test "$os" = "Darwin"
if pstree -s ranger | grep (echo %self) | grep -v grep > /dev/null
set ranger 1
end
end
if test "$os" = "Linux"
if pstree -p -l | grep "fish("(echo %self)")" | grep 'ranger([0-9]*)' > /dev/null
set ranger 1
end
end
if test -n "$ranger"
set ps_end $ps_end$ps_end
end
# last status give the color of the right arrows at the end of the prompt
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment