Comments (4)
I don't think this makes sense because Yazi's commands are executed concurrently. The show-input
command needs to wait for user input, so it's an asynchronous command. This means the shell
command will execute immediately without waiting for show-input
.
Also, while show-input
is running, any background plugin could interrupt it (plugins have full control over the input component), leading to incorrect shell parameters unless we introduce additional execution state between commands.
In Yazi, plugins are first-class citizens. The functionality you're describing can easily be implemented through the plugin system and would make a great general-use plugin. What you're asking for is very similar to https://github.com/Ape/open-with-cmd.yazi.
Given these reasons I'm going to close this issue as it's not in the plan.
from yazi.
I tried to create such a plugin, but with the current syntax of args
it looks pretty messy. Imagine something like that:
run = "plugin --async run-with-input --args='--block --confirm --title=\"Archive name:\" --command=\"zip %s $@\"'"
and it is just for a simple case. That's why it would be better to have it built-in. As you said, the current implementation wouldn't work because of asynchronous issues. So maybe, there could be introduced a different mechanism for such case?
Like:
run_with_input = "shell --block --confirm 'zip %s.zip $@'" , input_title = "Archive:"
However, I understand if you don't want to introduce more options in the config and if you prefer to delegate such cases to Lua.
from yazi.
I plan to simplify the shell
and plugin
commands in the next target (0.3.1) by adding macros. At that point, you'll be able to write it as:
!run-with-input "zip %s $@" --block --title="Archive name:"
where !run-with-input
represents plugin run-with-input --args='...'
(note that the plugin
command doesn't have the --async
flag because it's asynchronous by default).
The --confirm
option will also be deprecated in the next target, as it will no longer be necessary once we require the explicit --interactive
option.
Similarly, shell
commands will also be simplified. For example, shell --block --confirm 'echo "$@"'
can be written as :echo "$@"
.
I believe that through this series of simplifications, it will allow plugins to be more expressive.
from yazi.
Sounds great! Those changes will simplify keymaps a lot.
from yazi.
Related Issues (20)
- Exit select mode after finishing renaming the files. HOT 4
- DDS static messages only work when at least two instances of Yazi are running HOT 2
- Child process hangs waiting for EOF (end fo file) when using `stdin(Command.PIPED)` HOT 2
- Extract plugin fails to work on encrypted rar and zip archives HOT 4
- Opening multiple files only hovers the first file, others are directories HOT 2
- [RFC] Replace package manager URL from `yazi-rs/plugins#full-border` to `yazi-rs/plugins:full-border` HOT 10
- view files in /proc HOT 9
- [RFC] refactor and improve shell options HOT 1
- `cd --interactive` - some dirs/files icons are small until hovered HOT 6
- Add IF patched fonts HOT 1
- parquet HOT 1
- Moving folder into itself causes frozen task HOT 3
- Glob pattern matching also includes children in filetype rules HOT 4
- Insert keymap doesnt work HOT 7
- Multiple Keymap Actions result in erroneous behaviour. HOT 1
- Export list of key bindings
- Wrong behavior on opening file that contains space on Windows HOT 1
- Plugins like zoxide don't seem to work HOT 4
- Compilation issues while building from source HOT 3
- Yazi gets stuck when hovering over a specific text file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yazi.