From 79ca4cfe9dcff4eda66fbec41892413a66bfdb2a Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Tue, 27 Dec 2016 19:05:41 +0300 Subject: [PATCH] use /bin/sh as the default for shell option Mentioned in #58. --- doc.go | 2 +- docstring.go | 2 +- etc/lfrc.example | 7 +------ main.go | 1 - opts.go | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/doc.go b/doc.go index d538a97..d290473 100644 --- a/doc.go +++ b/doc.go @@ -57,7 +57,7 @@ The following options can be used to customize the behavior of lf: filesep string (default ":") ifs string (default "") (not exported if empty) previewer string (default "") (not filtered if empty) - shell string (default "$SHELL") + shell string (default "/bin/sh") showinfo string (default "none") sortby string (default "natural") timefmt string (default "Mon Jan _2 15:04:05 2006") diff --git a/docstring.go b/docstring.go index 0d55be7..012fca0 100644 --- a/docstring.go +++ b/docstring.go @@ -61,7 +61,7 @@ The following options can be used to customize the behavior of lf: filesep string (default ":") ifs string (default "") (not exported if empty) previewer string (default "") (not filtered if empty) - shell string (default "$SHELL") + shell string (default "/bin/sh") showinfo string (default "none") sortby string (default "natural") timefmt string (default "Mon Jan _2 15:04:05 2006") diff --git a/etc/lfrc.example b/etc/lfrc.example index 3effc4b..f72b5c7 100644 --- a/etc/lfrc.example +++ b/etc/lfrc.example @@ -5,12 +5,7 @@ #set nopreview #set showinfo size -# set shell interpreter accordingly -# Some systems use more efficient shell implementations for non-interactive use -# (e.g. `dash`) mapped to `/bin/sh`. By setting this option here we can tell -# `lf` to use this implementation for shell commands. This can decrease the -# startup times of commands but may also change the syntax that you are used to -# (e.g. non-POSIX features provided by your regular shell). +# interpreter for shell commands (needs to be POSIX compatible) #set shell /bin/sh # set internal field seperator (IFS) to ':' diff --git a/main.go b/main.go index 3a37a76..b460a16 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,6 @@ var ( envHome = os.Getenv("HOME") envHost = os.Getenv("HOSTNAME") envPath = os.Getenv("PATH") - envShell = os.Getenv("SHELL") envConfig = os.Getenv("XDG_CONFIG_HOME") ) diff --git a/opts.go b/opts.go index bc291da..7a8a839 100644 --- a/opts.go +++ b/opts.go @@ -29,7 +29,7 @@ func init() { gOpts.scrolloff = 0 gOpts.tabstop = 8 gOpts.filesep = ":" - gOpts.shell = envShell + gOpts.shell = "/bin/sh" gOpts.showinfo = "none" gOpts.sortby = "natural" gOpts.timefmt = time.ANSIC