Commit Graph

556 Commits (main)

Author SHA1 Message Date
Arijit Basu a8896740c8 Add sorting support
Also improve filtering.

Closes: https://github.com/sayanarijit/xplr/issues/58
3 years ago
Arijit Basu bbd5c1ba8b
Map V to `ctrl-a` 3 years ago
Arijit Basu 3ab9bcb4c9 Fix UI style priority
Fixes: https://github.com/sayanarijit/xplr/issues/68
3 years ago
Arijit Basu 54bad4aa09 Add mode selection commands
- SelectAll
- SelectPath
- UnSelectAll
- UnSelectPath
- ToggleSelectAll
- ToggleSelectionByPath
3 years ago
Arijit Basu 1dba3d5e8e Fix overwriting of default config.
This fixes the overwriting of default configuration.

Also, add tests to validate the new logic.

Fixes: https://github.com/sayanarijit/xplr/issues/68
3 years ago
Arijit Basu 0c82a645d9 Add history pipe 3 years ago
Arijit Basu d0342260fe Add support for NO_COLOR
Also, add `general.logs` to the config.

Ref: https://no-color.org/
3 years ago
Arijit Basu af1cda5762 Better symlink support
Closes: https://github.com/sayanarijit/xplr/issues/37
3 years ago
Arijit Basu 0d4cd29a08 Fix panic on permission denied
Issue:
$PWD watch service panics when visiting restricted directories.

Fix:
Log error instead of panic.
3 years ago
Arijit Basu ea42b1969a Improve scrolling behaviour
Closes: https://github.com/sayanarijit/xplr/issues/54
3 years ago
Arijit Basu c640edc4d9
Improve number mode clear behaviour 3 years ago
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
3 years ago
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
3 years ago
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.
3 years ago
Arijit Basu 055c1083d6 Support easier key remaps
Also,

- Add key binding `~` to go to homedir.
- Add customizable cursor and prompts.
- Improve the help menus.
3 years ago
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.
3 years ago
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
3 years ago
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
3 years ago
Arijit Basu 233f6d44a5
Update version 3 years ago
Arijit Basu 2af1b4c70a
Fix exit screen 3 years ago
Arijit Basu 2596c0c4c3 Remove task priority
Since we are now blocking on task inputs, the priority is no longer
required.
3 years ago
Arijit Basu 5030749ab1
Use `cp -vr` instead of `cp -v` 3 years ago
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.
3 years ago
deadjakk be2911e073 Fixed error preventing compilation
Removed comma.

Error was as follows:
error: no rules expected the token `,`
   --> src/input.rs:373:29
    |
373 |                 | Self::Num9,
    |                             ^ no rules expected this token in macro call

error: aborting due to previous error
3 years ago
Arijit Basu 588a50af7e Add support for custom metadata for table row UI
Example:

```yaml
filetypes:
  directory:
    custom:
      foo: bar
     ...
```

Where `foo` and `bar` can be anything string.

It can be accessed with the `{{{custom.foo}}}` variable.
3 years ago
Arijit Basu a68fec0c11
No need to clone selection 3 years ago
Arijit Basu b50ce48264
Revert "Optimize the main thread"
This reverts commit 097c9dd8c5.

Queued tasks might create unexpected issues. We need a test suit first.
3 years ago
Arijit Basu 097c9dd8c5 Optimize the main thread 3 years ago
Arijit Basu b9e9601a71
Fix failed build and update version 3 years ago
Arijit Basu b5986c59d6 Fix logs for being written in the pipe
Don't depend on `Refresh`, always write to the pipes.
3 years ago
Arijit Basu 2b0572228d
Draw once
Draw on the terminal only once i.e. when `Refresh`ing.
3 years ago
Arijit Basu ededb49bd4
Fix the help menu
`esc` no longer exits from the `default` mode.
3 years ago
Maxim Baz 70a3794857 Fix symlink support
canonicalize() and metadata() both resolve symlinks, thus showing symlinks as regular files
3 years ago
Arijit Basu c06a3cb51e
Update version 3 years ago
Arijit Basu 6d0ea06d7b Add pwd watcher
Also optimize the main thread.
3 years ago
Arijit Basu 0a3cf7b5c1
Update version 3 years ago
Arijit Basu 832016bb18 Stay in search mode when entering or leaving a directory
This might be a little counter intuitive to the `nnn` users, but I think
this will add to the productivity and should be the default.

Since we have a real-time mode indicator, users shouldn't face much of
an issue switching to the alternate default.
3 years ago
Arijit Basu 1e7e2ecc2f Add `:e` for "open in editor" 3 years ago
Arijit Basu fa4d4168cd Don't quit on esc
Issue:
`esc` is generally used to get back to the `default` mode and mistakenly
pressing `esc` while in `default` mode will annoyingly terminate the
session.

Fix:
Remove `esc` from the `default` mode's key bindings. Use `q` or `crtl-c`
instead.
3 years ago
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.
3 years ago
Arijit Basu e2b49ab4fd Display help menu using $PAGER
Also, use `open` to open files when `xdg-open` is missing.
3 years ago
Arijit Basu 45a95a792d Clear screen before exit 3 years ago
Arijit Basu 91a319fc80
Update version 3 years ago
Arijit Basu 57494f8ebf Do not print command outputs to the main screen.
Print all the outputs of xplr commands on the alternate screen. Not on
the real stdout.
3 years ago
Arijit Basu 7661019fd9 Make dir colors cyan
Fixes: https://github.com/sayanarijit/xplr/issues/11
3 years ago
Arijit Basu 23b51cf8fe
Fix failed build and re-publish 3 years ago
Arijit Basu 2bd2b743fb
Fix renaming 3 years ago
Arijit Basu a484c2fd39
Update default.nix 3 years ago
Arijit Basu e34755b11b Update version
Also fix nix hash
3 years ago
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
3 years ago
Arijit Basu 65ddb0ee4b
Release 0.3.2 3 years ago
Arijit Basu 53fd92b680 Fix debug formatting 3 years ago
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`.
3 years ago
Arijit Basu 0272284f40
Fix print formatting 3 years ago
Quentin Guilloteau a9309a52c0 add comment to remind to update the version in the default.nix file 3 years ago
Arijit Basu 175699ac63
Expose `$XPLR_PIPE_MODE_OUT`
Also, add new line character to `$XPLR_PIPE_MODE_OUT` and
`$XPLR_FOCUS_PATH` for consistency.
3 years ago
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.
3 years ago
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.
3 years ago
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.
3 years ago
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`]
3 years ago
Arijit Basu dba8631911 Add CI/CD gh actions
Mostly stolen from https://github.com/Rigellute/spotify-tui.
3 years ago
Arijit Basu 8dae2fef4d
Add native support for renaming 3 years ago
Arijit Basu 2f409a2117
Add support for `:{number}` like vim 3 years ago
Arijit Basu 2432673483
Log error if command fails 3 years ago
Arijit Basu b03618737c
Remove skim from dependency 3 years ago
Arijit Basu 4d2caf512e
Log explorer errors 3 years ago
Arijit Basu e93e815bc4
Add upgrade instructions for incompatibility error 3 years ago
Arijit Basu a11dca5a1c
Finish documenting the messages 3 years ago
Arijit Basu b98812fe06
Fix "Input" case 3 years ago
Arijit Basu 500f15bd32
Make UI lowercase 3 years ago
Arijit Basu 1b1cd393bc
Document a little 3 years ago
Arijit Basu af8a637030
Logging, testing and other improvements 3 years ago
Arijit Basu 71a23e1f64
Implement native search and filter 3 years ago
Arijit Basu 7cbb9d2baf
Saner key bindings 3 years ago
Arijit Basu c0ca596539
Fix create mode, refactor readers, fix init focus 3 years ago
Arijit Basu 3990200232
Anyhow handle errors 3 years ago
Arijit Basu 56d63a2316
Move, Copy, Create, Delete 3 years ago
Arijit Basu eb6bc6b6be
Minor buggy improvements 3 years ago
Arijit Basu 107211a69c
Add ctrl-c handler 3 years ago
Arijit Basu f43ba87a2b
Finish Selected -> Selection renaming 3 years ago
Arijit Basu 8a6da63936
Rename selected -> selection 3 years ago
Arijit Basu b70682ecb5
Fix term resize handler 3 years ago
Arijit Basu 54b6a8e4da
Minor fix 3 years ago
Arijit Basu 2c56b80fde
Minor fixes 3 years ago
Arijit Basu f176655325
Some improvements and cleanup 3 years ago
Arijit Basu 341d11a0f3
Fix pipes config 3 years ago
Arijit Basu c066201777
Read config from file 3 years ago
Arijit Basu 3572d26b95
Too big of a rewrite 3 years ago
Arijit Basu 98920637f9
Number input 3 years ago
Arijit Basu 53b18ae8f4
Use # instead of ? to debug app 3 years ago
Arijit Basu d5bfe6630f
Use app.task instead of separate variables 3 years ago
Arijit Basu 21e4a178c7
Fix escaping relative path
Either escape or quote. Don't do both at once.
3 years ago
Arijit Basu d3f88a1fa5
Display mode in help menu title 3 years ago
Arijit Basu 096489dee4
Use "esc" instead of "escape" 3 years ago
Arijit Basu 669151c70e
Show help menu 3 years ago
Arijit Basu 7beaec1763
Easier key handling 3 years ago
Arijit Basu 8221140756
Refresh after running command 3 years ago
Arijit Basu 044b7860a1
Fixed fzf search added pwd shell option
Now I can finally use it to replace nnn
3 years ago
Arijit Basu 980fb8728a
Editor fix 3 years ago
Arijit Basu 03fffd19e2
Minor fixes 3 years ago
Arijit Basu df8c03ce2d
Add shell words escaper 3 years ago
Arijit Basu 2e551ce38d
Support for command action 3 years ago
Arijit Basu 758f362fee
Lazy programmer hack for key bindings 3 years ago
Arijit Basu 720ba38b4d
Some important fix (don't look) 3 years ago
Arijit Basu 41713f9aff
Basically working now. 3 years ago
Arijit Basu f9c3edee06
Not yet doing what it's supposed to 3 years ago