aboutsummaryrefslogtreecommitdiff
path: root/bindings.bb
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-10-02 13:29:25 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-10-02 13:29:25 -0700
commit05e37166fce89a95561de1f5a95e52dd6e284333 (patch)
treefcc2d95c024ca8a5aa6ad96a105da418e9d8b552 /bindings.bb
parente25eaf9b92b62027ede8a8b142dadfb8d95c227a (diff)
Fixed 'Enter' key behavior (should work properly for mac again now)
Diffstat (limited to 'bindings.bb')
-rw-r--r--bindings.bb12
1 files changed, 9 insertions, 3 deletions
diff --git a/bindings.bb b/bindings.bb
index 259b8d4..8551056 100644
--- a/bindings.bb
+++ b/bindings.bb
@@ -78,9 +78,15 @@ Ctrl-a: # Select all files here
Section: File Actions
Enter: # Open file/directory
- if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR";
- elif file -bi "$BBCURSOR" | grep -q '^\(text/\|inode/empty\)'; then $EDITOR "$BBCURSOR";
- else open "$BBCURSOR"; fi
+ if [ "$(uname)" = "Darwin" ]; then
+ if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR";
+ elif file -bI "$BBCURSOR" | grep -q '^\(text/\|inode/empty\)'; then $EDITOR "$BBCURSOR";
+ else open "$BBCURSOR"; fi
+ else
+ if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR";
+ elif file -bi "$BBCURSOR" | grep -q '^\(text/\|inode/empty\)'; then $EDITOR "$BBCURSOR";
+ else xdg-open "$BBCURSOR"; fi
+ fi
e: # Edit file in $EDITOR
$EDITOR "$BBCURSOR" || pause
d: # Delete a file