about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--code/help.rb15
-rwxr-xr-xranger9
2 files changed, 16 insertions, 8 deletions
diff --git a/code/help.rb b/code/help.rb
index 11e3f0ae..bd6568c4 100644
--- a/code/help.rb
+++ b/code/help.rb
@@ -246,16 +246,17 @@ module Fm
 	left with ranger.
 
 	To use this feature, you have to start ranger with:
-	. /path/to/ranger
+	source /path/to/ranger /path/to/ranger
 	
-	The dot and space at the start is important!
+	If you have ranger in your /usr/bin/, you can write:
+	source ranger ranger
 
-	of course you can create an alias in our ~/.bashrc
-	alias fm='. /path/to/ranger'
+	Of course you can create an alias in our ~/.bashrc
+	alias ranger='source ranger ranger'
+
+	It's 2x ranger in "source ranger ranger" because shells are silly
+	and there was no other way to do it.
 
-	I use fm (which means filemanager) because it's quick to type
-	and because fm was the working title of ranger in the early days.
-	
 
 	If you're inside ranger and decide to stay in the original directory
 	after all, you can type tc or quit with ZX
diff --git a/ranger b/ranger
index dbe73903..6c961c92 100755
--- a/ranger
+++ b/ranger
@@ -5,7 +5,9 @@
 
 if false; then
 =begin
-fi; cd "`ranger --cd $@ 3>&1 1>&2`"; return
+fi
+cd "`$1 --workaround $@ 3>&1 1>&2`"
+return
 =end
 end
 
@@ -20,6 +22,11 @@ $: << MYDIR = File.dirname(Pathname(__FILE__).realpath)
 ##--------------------------------------------------
 # parse arguments
 
+if ARGV[1] == '--workaround'
+	ARGV.shift(2)
+	ARGV.unshift('--cd')
+end
+
 ARGV.delete('--cd') if cd = ARGV.include?('--cd')
 if ARGV.size > 0
 	case ARGV.first