Comments (2)
However, all these solutions would require a breaking change in Joshuto: %s would change to something else, for example {{s}}. @kamiyaa: Would that be acceptable?
I'm cool with breaking changes if it means better UX and maintainability moving forward
from joshuto.
Hi,
I'm not much further on this, I just was too busy with other stuff.
However, I did some experimental implementations around Christmas and I came to the conclusion that a generic variable solution I had in mind won't work well with the current way Joshuto parses the command line input. To get such a solution straight, it would require a complete refactoring of Joshuto's command handling. The problem is mostly with escaping and quoting (I don't even remember all the details). I thought of introducing some CLI parser library (like clap
) to parse the commands, but that would be too much effort for me at the moment. In any case, it would have some negative impact on performance. (don't know how much; maybe negligible).
I then re-thought to just introduce new variables the same way we already have %s
, but this also has significant downsides (my personal notes here, in case somebody is really interested). Essentially, each command needs to implement each supported variable on its own and I think this could turn into quite some mess (code-wise) and a non-intuitive UI.
My latest idea now is to leave all commands just as they are but to introduce one new command, which I currently call stdout
in my head. This command's job is to do something with the stdout of the last shell
command.
This stdout
command would take an action as first (and usually only) parameter. An action could for example be
cd
: jump to the directory given as stdoutnew-tabs
: open a new tab for each line of stdoutjump-tab-name
: activate the tab with the directory given as stdoutselect-names
: select the files which as listed by name in stdoutselect-indexes
: select the files with the indexes listed in stdout- ...
So, instead of using variables with the stdout
content for the existing command, I would add one new command that takes some โlast-stdoutโ specific action as parameter. It's less generic, but more explicit and does not negatively impact the code, the usability, or the performance.
Just dumping my thoughts here. If somebody has ideas or opinions, feel free.... ๐
I hope I will finally find some time to work on this.
from joshuto.
Related Issues (20)
- Latest release doesn't build HOT 1
- v0.9.7 - `Cargo.toml` does not match `Cargo.lock` HOT 2
- feature request: change, simplify joshuto image preview HOT 2
- [BUG] Fatal crash when I return to joshuto from a shell HOT 4
- Use of `--change-directory` command line argument? HOT 1
- Configure ratatui-image preview background/frame color.
- [BUG] Linemode 'sizemtime' unknown. HOT 1
- [FEATURE] More linemodes and sort modes
- linux gnu build error
- Directory chooser HOT 2
- [Help wanted] Creating a custom script to use joshuto to control imv. HOT 1
- Feature request: delete colon to exit command mode
- Feature request: implement scrollable preview area HOT 2
- [Bug] File preview(with bat) does not update after file modification with vim
- Feature request: Add options to pre-select a file on start HOT 2
- Unable to select neovim config with NVIM_APPNAME environment variable
- Feature Request: add more useful variables for shell/spawn commands HOT 1
- Feature request: keybinding `v` by default to mark all files / folders in current view
- Feature request: add `bat` as fallback for viewing HTML / JSON in `preview_file.sh`
- symlink not work on macos
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 joshuto.