Commit Graph

129 Commits

Author SHA1 Message Date
Arijit Basu
785c20de13 Sync pwd
Sync session's $PWD with `xplr`'s current directory.
If you use alacritty, every window will open in `xplr`'s current
directory.
2021-04-20 20:56:16 +05:30
Arijit Basu
c11099f651 Fix follow symlink behavior.
Use `gf` to follow symlinks instead of `enter`/`l`.

Or use the message `FollowSymlink`.
2021-04-19 23:23:28 +05:30
Arijit Basu
87cd6ff015 Fix global help menu not displaying sort & filter 2021-04-19 21:01:20 +05:30
Arijit Basu
1f99e8ba99 Follow file symlinks
Follow symlink to files to it's parent directory.

Also, hide file size for directories.

Ref: https://github.com/sayanarijit/xplr/issues/84
2021-04-19 18:32:00 +05:30
Arijit Basu
ca13ebb193 Added inode size
Also supports sorting by inode size.

Closes: https://github.com/sayanarijit/xplr/issues/84
2021-04-19 14:48:45 +05:30
Arijit Basu
b53f0c21bb Improve read-only mode
Do not include non-read-only actions in the in read-only mode. i.e. do
not display non-read-only actions in help menu.

Ref: https://github.com/sayanarijit/xplr/issues/22
2021-04-19 14:33:42 +05:30
Arijit Basu
21f87d6a08 Add read-only mode
Ref: https://github.com/sayanarijit/xplr/issues/22
2021-04-19 10:27:27 +05:30
Arijit Basu
e70fa57228 Fix selection
Fixes: https://github.com/sayanarijit/xplr/issues/81
2021-04-19 00:58:04 +05:30
Arijit Basu
1bb2622f24 Improve key inputs
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: https://github.com/sayanarijit/xplr/issues/77
2021-04-19 00:00:43 +05:30
Arijit Basu
a8896740c8 Add sorting support
Also improve filtering.

Closes: https://github.com/sayanarijit/xplr/issues/58
2021-04-18 16:14:17 +05:30
Arijit Basu
54bad4aa09 Add mode selection commands
- SelectAll
- SelectPath
- UnSelectAll
- UnSelectPath
- ToggleSelectAll
- ToggleSelectionByPath
2021-04-15 14:36:52 +05:30
Arijit Basu
0c82a645d9 Add history pipe 2021-04-14 21:16:16 +05:30
Arijit Basu
af1cda5762 Better symlink support
Closes: https://github.com/sayanarijit/xplr/issues/37
2021-04-13 08:48:50 +05:30
Arijit Basu
49ffd8e1f1 Fix exit error codes
Also remove cucumber-rust (will try https://github.com/rust-rspec/rspec)

Fixes: https://github.com/sayanarijit/xplr/issues/33
2021-04-12 11:13:31 +05:30
Arijit Basu
55e1a6a0fa Add basic history navigation
Use `ctrl-i` (tab) and `ctrl-o` to navigate history.

Closes: https://github.com/sayanarijit/xplr/issues/49
2021-04-12 11:03:57 +05:30
Arijit Basu
f247acf626 Fix remap behaviour and help menu
Remapping a key should overwrite default. Also, remapped keys shouldn't
be redundantly visible in help menu.

Also, display log time.
2021-04-11 22:22:36 +05:30
Arijit Basu
055c1083d6 Support easier key remaps
Also,

- Add key binding `~` to go to homedir.
- Add customizable cursor and prompts.
- Improve the help menus.
2021-04-11 21:15:01 +05:30
Arijit Basu
080e1686f3 Improve version compatibility
From this version, xplr won't annoy the users to visit the upgrade guide
when there is no need.

Also, users will only get upgrade related notification when it is
there is one.
2021-04-11 21:15:01 +05:30
Arijit Basu
3598be0f19 Improve config defaults
- Rename `custom` field for node metadata to `meta`.
- Move `icon` to `meta.icon`.
- Rename `normal_ui` to `default_ui`.
- Rename `filetypes` to `node_types`.
- Split `modes` into `modes.builtin` and `modes.custom`.
- Add the missing `create file` mode.
- Rename `focused_ui` to `focus_ui`.
- Make `general.table.header` non-nullable.
- Add support for incremental configuration updates.

Ref: https://github.com/sayanarijit/xplr/issues/45
2021-04-11 21:15:01 +05:30
Arijit Basu
6aa3df301e Separate config.yml file from rust files
Also be less aggressive for version compatibility.

Use the following logic:

Knowing that we use `{major}.{minor}.{patch}` versioning,

- Major version mismatch are incompatible. Fail with error, suggesting to
  visit the Upgrade Guide.
- Minor version updates and patch fixes are compatible. Suggest user to
  update the config file version manually. Or visit the Upgrade Guide.

- However, if the config file has greater value for minor version
  than the app, also fail with error. Suggesting the user to visit Upgrade
  Guide. Though in this case, the user will be downgrading.

Ref: https://github.com/sayanarijit/xplr/issues/45
2021-04-09 23:57:39 +05:30
Arijit Basu
233f6d44a5
Update version 2021-04-09 16:26:45 +05:30
Arijit Basu
2596c0c4c3 Remove task priority
Since we are now blocking on task inputs, the priority is no longer
required.
2021-04-09 15:29:05 +05:30
Arijit Basu
9f78a1fcff Ability to call commands silently
Some commands doesn't require to capture stdout and stderr.
They can be called without needing to reset the screen.

Add `CallSilently` and `BashExecSilently` to execute those commands
faster.

Also, some optimization.
2021-04-09 14:28:32 +05:30
Arijit Basu
a68fec0c11
No need to clone selection 2021-04-09 10:56:39 +05:30
Arijit Basu
b50ce48264
Revert "Optimize the main thread"
This reverts commit 097c9dd8c5.

Queued tasks might create unexpected issues. We need a test suit first.
2021-04-09 10:54:20 +05:30
Arijit Basu
097c9dd8c5 Optimize the main thread 2021-04-09 10:51:48 +05:30
Arijit Basu
b9e9601a71
Fix failed build and update version 2021-04-09 08:21:30 +05:30
Maxim Baz
70a3794857 Fix symlink support
canonicalize() and metadata() both resolve symlinks, thus showing symlinks as regular files
2021-04-09 06:43:58 +05:30
Arijit Basu
c06a3cb51e
Update version 2021-04-09 04:19:26 +05:30
Arijit Basu
6d0ea06d7b Add pwd watcher
Also optimize the main thread.
2021-04-09 04:19:44 +05:30
Arijit Basu
0a3cf7b5c1
Update version 2021-04-09 01:29:38 +05:30
Arijit Basu
fa37cd1c10 Improve search and filter
Concern:
Using `ResetNodeFilters` to clear the filters while searching or exiting
from search unexpectedly resets the `show hidden` mode because the
action not only removes the target filter, it resets all the other
filters as well.

Solution:
Implement `RemoveNodeFilterFromInput` to be able to clear or remove
target filters without having to reset it.
2021-04-08 08:01:10 +05:30
Arijit Basu
91a319fc80
Update version 2021-04-07 19:57:25 +05:30
Arijit Basu
23b51cf8fe
Fix failed build and re-publish 2021-04-07 03:06:47 +05:30
Arijit Basu
2bd2b743fb
Fix renaming 2021-04-07 02:42:20 +05:30
Arijit Basu
a484c2fd39
Update default.nix 2021-04-07 02:14:43 +05:30
Arijit Basu
e34755b11b Update version
Also fix nix hash
2021-04-07 01:59:02 +05:30
Arijit Basu
09abda29a3 Several optimizations
- Write to pipes only when the value changes.
- Sleep when not reading key event or messages.

Fixes: https://github.com/sayanarijit/xplr/issues/10
2021-04-07 01:59:02 +05:30
Arijit Basu
65ddb0ee4b
Release 0.3.2 2021-04-06 18:55:57 +05:30
Arijit Basu
65b7412579 Add XPLR_APP_VERSION and XPLR_CONFIG_VERSION
Since users don't need to update config file version for minor app
releases, we have to differentiate between app and config version.

Also, expose them via `$XPLR_CONFIG_VERSION` and `$XPLR_APP_VERSION`.
2021-04-06 18:23:19 +05:30
Quentin Guilloteau
a9309a52c0 add comment to remind to update the version in the default.nix file 2021-04-06 16:59:58 +05:30
Arijit Basu
eeee3394bc Improve version incompatibility error
With this change, `xplr` will only raise version incompatibility error
if the major version changes. Minor version updates are assumed to be
backwards compatible.

If the major version is `v0`, the minor version will be considered as
the major version and the security/patch version will be considered as
minor version and the same logic will apply.
2021-04-06 06:43:51 +05:30
Arijit Basu
981ead8c36 Fix large env vars breaking the subprocess
Bug:
When you call some command in a directory with a large number of hosts,
xplr will fail setting the environment vars as the command will become
too large to handle.

Fix:
Port the value of multi-line variables from env vars to pipes and set
the name of the pipe as env var instead. And deprecate the variables
that doesn't make much sense.

In other words,

- `$XPLR_APP_YAML` has been removed.
- `$XPLR_RESULT` has been ported to `$XPLR_PIPE_RESULT_OUT`.
- `$XPLR_GLOBAL_HELP_MENU` has been ported to
  `$XPLR_PIPE_GLOBAL_HELP_MENU_OUT`.
- `$XPLR_DIRECTORY_NODES` has been ported to
  `$XPLR_PIPE_DIRECTORY_NODES_OUT`.
- `$XPLR_LOGS` has been ported to `$XPLR_PIPE_LOGS_OUT`.
- `$XPLR_PIPE_RESULT` has been ported to `$XPLR_PIPE_RESULT_OUT`.

Hence, instead of `<<< $VAR`, `< $VAR_PIPE_OUT` should be used.
2021-04-05 20:28:35 +05:30
Arijit Basu
9747c8667b Autocomplete the relative path while renaming
By default, while renaming a file, autocomplete the relative path i.e.
the filename instead of the absolute path in the input buffer.
2021-04-05 13:50:53 +05:30
Arijit Basu
67f2094a4c Autorefresh, BashExec and basename
- Auto `Refresh` every second.
- Add alias `BashExec` to message `Call` with args [`-c`, `bash` ...].

Also, Create alias `BashExec` to message `Call` with arguments [`bash`, `-c`]
2021-04-05 12:51:31 +05:30
Arijit Basu
dba8631911 Add CI/CD gh actions
Mostly stolen from https://github.com/Rigellute/spotify-tui.
2021-04-05 12:32:40 +05:30
Arijit Basu
8dae2fef4d
Add native support for renaming 2021-04-04 16:47:03 +05:30
Arijit Basu
2432673483
Log error if command fails 2021-04-04 15:18:13 +05:30
Arijit Basu
b03618737c
Remove skim from dependency 2021-04-04 11:56:44 +05:30
Arijit Basu
4d2caf512e
Log explorer errors 2021-04-04 10:05:52 +05:30
Arijit Basu
e93e815bc4
Add upgrade instructions for incompatibility error 2021-04-04 09:17:53 +05:30
Arijit Basu
a11dca5a1c
Finish documenting the messages 2021-04-04 08:54:42 +05:30
Arijit Basu
1b1cd393bc
Document a little 2021-04-03 15:27:15 +05:30
Arijit Basu
af8a637030
Logging, testing and other improvements 2021-04-03 11:32:05 +05:30
Arijit Basu
71a23e1f64
Implement native search and filter 2021-04-03 06:49:59 +05:30
Arijit Basu
7cbb9d2baf
Saner key bindings 2021-04-02 19:56:18 +05:30
Arijit Basu
c0ca596539
Fix create mode, refactor readers, fix init focus 2021-04-02 18:03:56 +05:30
Arijit Basu
3990200232
Anyhow handle errors 2021-04-02 17:11:18 +05:30
Arijit Basu
56d63a2316
Move, Copy, Create, Delete 2021-04-02 16:12:10 +05:30
Arijit Basu
eb6bc6b6be
Minor buggy improvements 2021-04-02 09:28:20 +05:30
Arijit Basu
107211a69c
Add ctrl-c handler 2021-04-02 07:53:13 +05:30
Arijit Basu
f43ba87a2b
Finish Selected -> Selection renaming 2021-04-02 07:45:00 +05:30
Arijit Basu
8a6da63936
Rename selected -> selection 2021-04-02 07:40:51 +05:30
Arijit Basu
b70682ecb5
Fix term resize handler 2021-04-02 05:59:56 +05:30
Arijit Basu
2c56b80fde
Minor fixes 2021-04-01 22:34:12 +05:30
Arijit Basu
f176655325
Some improvements and cleanup 2021-04-01 19:34:45 +05:30
Arijit Basu
341d11a0f3
Fix pipes config 2021-04-01 16:24:03 +05:30
Arijit Basu
c066201777
Read config from file 2021-04-01 15:28:32 +05:30
Arijit Basu
3572d26b95
Too big of a rewrite 2021-04-01 15:17:24 +05:30
Arijit Basu
98920637f9
Number input 2021-03-15 14:49:30 +05:30
Arijit Basu
d5bfe6630f
Use app.task instead of separate variables 2021-03-13 15:31:25 +05:30
Arijit Basu
21e4a178c7
Fix escaping relative path
Either escape or quote. Don't do both at once.
2021-03-09 14:43:43 +05:30
Arijit Basu
096489dee4
Use "esc" instead of "escape" 2021-03-04 20:50:33 +05:30
Arijit Basu
669151c70e
Show help menu 2021-03-04 20:12:47 +05:30
Arijit Basu
7beaec1763
Easier key handling 2021-03-04 11:42:32 +05:30
Arijit Basu
8221140756
Refresh after running command 2021-03-03 20:55:01 +05:30
Arijit Basu
044b7860a1
Fixed fzf search added pwd shell option
Now I can finally use it to replace nnn
2021-03-03 00:15:21 +05:30
Arijit Basu
2e551ce38d
Support for command action 2021-03-02 14:24:43 +05:30
Arijit Basu
f9c3edee06
Not yet doing what it's supposed to 2021-03-01 16:53:04 +05:30