Commit Graph
64 Commits
Author SHA1 Message Date
Joe Lim 02156a3806 Export command line flags as environment variables (#2079) 2025-08-07 15:59:13 +10:00
CatsDeservePets bfea67dec6 Don't export nkeys and vkeys as environment variables (#2039) 2025-07-18 01:47:30 +10:00
Joe Lim 44e716d2f1 Ignore updates for log file when watch is enabled (#2015)
* Ignore updates for log file when `watch` is enabled

* Move check earlier

* Ignore write event only

* fix message
2025-06-20 20:58:56 +10:00
Joe Lim 2494b3f632 Fix quoting of lf environment variable for pwsh (#1990)
* Fix quoting of `lf` environment variable for pwsh

* Simplify lfrc

* typo

* Remove redundant/irrelevant pwsh configs
2025-05-17 19:30:37 +10:00
David Pedersen 2a3292560d Apply modernization fixes (#1921) 2025-02-23 17:05:20 +11:00
Joe Lim b401318046 Implement sort options as separate variables (#1577) 2024-01-18 11:15:06 +11:00
Michael GalloandJoe Lim e1ab72516d sortMethod simplification. (#1535)
* made sortMethod a string enum to reduce comparisons and repetition

* main uses sortmethod directly instead of converting it into a string

* updated sortmethod validity check to no longer require slices package

* Update opts.go

Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>

---------

Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>
2023-12-26 15:55:42 +01:00
David Pedersen a51462dcb9 Show git commit if version information is missing (#1517)
* Show git commit if version information is missing

* Update version command format
2023-12-26 15:41:15 +01:00
Gökçehan Kara 9698ecddf1 use markdown for the documentation (#1474)
* add doc.md

* use h2 for doc sections

* use h3 for doc commands/options/vars

* use backticks instead of quotes in the doc

* merge multiple commands/options in the doc

* change header levels in the doc

* add man page sections to the doc

* remove extra spaces in headers in the doc

* add man and plain conversions of the doc

* update doc

* add missing flags to the doc

* replace the old documentation with the new one

* remove old doc files

* remove the doc instructions from CONTRIBUTING.md

* change the links to the doc

* shorten long links in the readme
2023-11-12 15:43:06 +01:00
Joe Lim 6aa3d2aa18 Add -print-last-dir and -print-selection flags (#1402)
* Add `-print-last-dir` and `-print-selection` flags

* Add shell completions

* Update `lfcd.sh` example to use new flag
2023-08-31 10:10:31 +10:00
Joe Lim 592e7fe4be Improve windows shell handling (#1309)
* Improve windows shell handling

* Add shell in command line

* Fix shellopts bug

* Add quote string

* Refactor `exportFiles` function

* Add defaults for Windows

* Revert "Add defaults for Windows"

Accidental commit

This reverts commit 5ff32650fe.

* Separate handling for CMD vs PowerShell

* Add case insensitive check
2023-07-03 17:31:45 +03:00
Joe Lim e08eebb115 Add support for displaying lf options in the ruler (#1257)
* Add support for displaying lf options in the ruler

* Print escape character as plain text

* Document user defined options

* Change escape rules

* Use reflect instead of environment table

* Factor out common option map logic

* Improve error message slightly

* Display blank option values
2023-05-24 12:30:38 +03:00
Joe Lim 2a5c54c81a Minor cleanup of reflect code (#1229) 2023-05-13 16:30:19 +03:00
Ilya Grigoriev 27ab67aab7 Make the :doc command work even if lf is not in the PATH, add lf environment variable (#1176)
* Export a `$lf` environment variable with path to lf binary

If Go fails to find a path to the lf binary, `$lf` is set to the string `lf` so
that running `$lf` in scripts gives a reasonable error message.

* Make the `:doc` command work even if lf is not in the PATH

Previously, `:doc` executed `lf -doc`. Now, it executed `$lf -doc` or `%lf%
-doc`.

Before this change, `:doc` did not work if `lf` is not in the PATH. This is
likely to happen to new users who are trying out `lf` and need docs the most.

Moreover, if you made some changes to the docs and ran `lf` with `go run .`,
`:doc` would return the docs for the version of `lf` in the PATH instead of
what is expected.
2023-04-01 19:49:47 +03:00
Christian Zangl a2fed6d16e add user defined options (#865) 2022-10-15 15:50:21 +03:00
Gokcehan fe59f0f30c update doc 2022-04-02 21:18:05 +03:00
Gokcehan 07b35def77 add missing error contexts for getwd calls 2022-03-06 18:46:53 +03:00
Gokcehan 47620fa680 add command line option for log file
cc #739
2022-02-06 19:51:52 +03:00
Christian Zangl 761aa23483 add select-path to -help (#749) 2022-02-04 23:32:34 +03:00
Gokcehan 7cdb7495ea add a command line parameter for single use
cc #177
2021-05-19 23:38:05 +03:00
Gokcehan 4601e74d66 export OLDPWD variable as the initial directory
cc #601
2021-04-13 23:48:49 +03:00
Gokcehan c8f60623f3 cleanup 2021-04-13 23:29:26 +03:00
SPFab a9cb7156a3 added ability to use custom config file (#587) 2021-03-09 14:35:50 +03:00
Marius 8e09df5969 Allow multiple -command flags (#552) 2021-01-07 01:10:54 +03:00
Eduard Ganiukov d62dd9353f client: use PID as a client ID (#550)
Fixes: #549
2021-01-03 01:58:01 +03:00
Gokcehan 90b3b166e1 import tcell/v2 from gitlab.com/Provessor/lfp 2020-12-04 23:59:12 +03:00
gotroyb127 7a3bd15903 always export lf_options before previewing (#468)
* always export lf_options before previewing

related functions were moved to `os.go`
and now exportOpts isn't called through
an app, so it can be called independently

* move related functions to main.go

so they get compiled on windows too
2020-09-18 00:50:45 +03:00
Provessor 61442f8880 A more robust server starting mechanism (#463)
now lf will start the server in the current directory (which will then
Chdir to the user's home directory) to ensure it is always starting as
the user intended.
2020-09-09 14:08:52 +03:00
Provessor 24f01f4988 Replace termbox-go with tcell (#439)
Fix colour construction issue

This also has a test to mitigate it in the future

Remove `colormode` option

The original issue it was trying to solve is no longer present with
tcell (it being a holdover from `color256` on termbox) so it is not
needed.

retire gitter channel in favor of irc/matrix

Export options as environment variables (#448)

* Export options as environment variables

Any options from gOpts are available via lf_OPTION environment
variables. For now it works only on booleans, integers and strings (no
array support)

* Do not export some of the options

* Add support for arrays and fix numbers

* Fix comments

* Replace 1 and 0 with true and false

* Export hidden,reverse,dirfirst and sortby options

* Fix comments

* Little fix

* Simplify boolean conversion

log readlink errors instead of fail

Related #447 and #374
2020-09-01 15:42:44 +03:00
Gokcehan ce4ea6ea53 start server process in home directory
Related #287
2020-07-04 03:41:37 +03:00
Gokcehan 45270e389e export id variable after initialization 2019-03-31 19:45:11 +03:00
Gokcehan 0eedb71d6c export permanent env vars on startup
Related #134
2019-03-17 19:52:34 +03:00
Gokcehan 599ac11f26 cleanup 2019-02-26 21:27:04 +03:00
Gokcehan 27f104b3e6 select first argument on startup
Related #101
2019-02-10 19:48:49 +03:00
Daniel Lewan 0fc14e3b2d add option to execute command on server initialization (#135) 2019-02-06 14:56:06 +03:00
Gokcehan 0b8de7c77e detach server on windows
Related #106
2018-08-01 00:21:55 +03:00
Gokcehan d3f9a3588f handle non-existent directories during reload 2018-07-30 20:56:57 +03:00
Gokcehan e82cbb820f export 'LF_LEVEL' variable for nested instances
Related #107
2018-07-28 16:52:54 +03:00
Gokcehan 448f2a3cb2 restart server when crashed
Related #65
2018-06-05 22:11:20 +03:00
Gokcehan 91c3790032 add version to the binary
Related #95
2018-03-22 20:42:15 +03:00
Gokcehan 4ce6980098 add command line option for memory profiling 2018-02-17 19:22:40 +03:00
Gokcehan 9b7bf63096 cleanup 2017-11-19 21:55:13 +03:00
Gokcehan 94bb62f7c0 change directory to the first argument on startup
Mentioned in #63.
2017-10-30 23:08:39 +03:00
Gokcehan 8072801bf0 fix init order of sockets for remote commands 2017-08-06 18:26:38 +03:00
Gokcehan cb577a4c3a handle user variables on all platforms 2017-08-06 11:05:46 +03:00
Gokcehan 458bc71688 use conditional compilation for windows 2017-08-05 19:23:55 +03:00
Gokcehan e654700bd2 use tcp sockets on windows
Mentioned in #12.
2017-07-23 17:14:50 +03:00
Gokcehan 33c55f0f51 fix selection-path switch help message
Mentioned in #82.
2017-05-14 18:22:46 +03:00
Gokcehan 79ca4cfe9d use /bin/sh as the default for shell option
Mentioned in #58.
2016-12-27 19:05:41 +03:00
Gokcehan 0298630114 add remote flag to send remote commands to server
Mentioned in #45.
2016-12-19 21:28:57 +03:00