-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development -> Master (0.10.0-dev) #27
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Use Nucleo/Ratatui for better customization - Immediately open picker and stream workspace matches into the picker - This feels snappier + allows you to make a selection before the list is done loading - Allow to open a workspace in a group from the main workspace finder - Currently we have implemented a `tmm -g` flag that opens a finder showing existing sessions which, when selected, opens a new session in a group with the selected session. - Something this change adds experimental support for is clicking `Ctrl/Shift/Alt` + Enter from the main workspace finder to *attempt* to open the selected workspace as a new group session. twm will search for a twm-generated session with `TWM_ROOT` set to the path of the selected workspace and if found, open your new session in a group with it. Otherwise, it behaves normally. - This hasn't really been tested much yet, and it seems(?) crossterm doesn't support `Ctrl/Shift` + `Enter` on Linux (or is it just some terminals?), but `Alt` + `Enter` is working for me. I've left all 3 options in currently to try testing on more systems/terminals.
) * Add CLI flags to print configuration schemas - Adds a `--schema` and `--layout-schema` flag that print the configuration file specifications for the `twm.yaml` configuration and `.twm.yaml` layout files respectively * add option to write a default config file with the schema defined * Add config file path override Adds the option to override the search path(s) for the `twm.yaml` config file by setting the environment variable `TWM_CONFIG_FILE`. This should simply be the path to the desired configuration.
* Add flags to print shell completions * Add flag to print man page * Update some cli args & make the flake install comppletions & man page
- Replaces WalkDir with jwalk - Uses rayon for multithreading when checking if directories match our workspace definitions My current setup on current development branch `twm` takes about ~0.15 seconds to load all workspace matches into the picker. With this change it is nearly instant & I can't even see the number climb The difference this makes on my old slow laptop is huge. For low depth searches, it's about the same in my tests so far.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improvements & Features
Performance
twm
is multithreaded now, usingjwalk
instead ofWalkDir
and usingRayon
directly to process workspace matches.Didn't do any super scientific benchmarks but I've seen anywhere from a 0%-300% improvement depending on configuration and hardware, but more commonly 100%-200%.
In the most extreme cases with search depths of 10+, it can be 10x more performant than before.
Streaming workspaces to the picker asynchronously
The old implementation searched for all workspaces synchronously and then send them to a
Skim
picker. If you were on slow hardware, had a lot of workspaces, a complicated workspace-search configuration, or just a highmax_search_depth
, there could be a noticeable delay. Especially if you met multiple of those criteria.In the new version, we ditched the dependency on
Skim
and used Helix'sNucleo
picker withRatatui
/Crossterm
to implement the TUI picker.The new implementation spawns a second thread for finding workspaces and streams them into the picker, so the picker opens ~instantly always now, no matter your config/hardware. You can type, move around, and make your selection while the background thread is still streaming results in. This has been great for me so far where I have muscle memory and I know that to get to a certain workspace I need to just type
.n
orz
, etc. I can now open those up as fast as I can type the lettersNote: one annoying thing that I haven't found a way to work around yet is that the matching algorithm is different & seemingly less configurable out-of-the-box than
Skim
's was. This results in a having to relearn muscle memory for some of my workspaces. I will spend more time looking into this to see if I can make it more consistent. I hope it isn't too big of a problem.Opening a new session in a group without
-g
Instead of just pressing
Enter
on your selection in the main workspace picker, you can useShift/Ctrl/Alt
+Enter
to attempt to open the path as a new session in an existing group. If no existing session for that path is found, it is opened normally. If one is found, it opens in a group (same as it would withtwm -g
).Open to taking other suggestions for what key(s) should invoke this behavior. It seems that none of these are super consistently supported by
Crossterm
across platforms&terminals.Alt+Enter
seems consistent on Linux. I haven't had a chance to try other OS yetCLI
--make-default-config
writes a default configuration file and accompanying schema, by default to
$XDG_CONFIG_HOME/twm/{twm.yaml,twm.schema.json}
. if you pass-p/--path <PATH>
with this, it will write to the directory given.We first check that neither of the files we intend to write, and won't overwrite existing files, asking the user to move/rename existing files and try again.
I originally never wanted to bother adding something like this, but since I discovered the
schemars
crate to automatically export the configuration file's schema, it feels like there is value here now, since calling this flag will set up a configuration file with up-to-date schema validation for free.--make-default-layout-config
writes a default config file for a
.twm.yaml
layout fileThis one does not include a
.twm.schema.json
file, because the whole schema is contained in the default template. If desired, you can usetwm --print-layout-config-schema > schema.json
--print-config-schema
prints the JSON-formatted configuration schema to stdout
Useful for same as above. If you update
twm
every so often you couldtwm --print-config-schema > ~/.config/twm/twm.schema.json
to get updated editor completion/validation when editing your config--print-layout-config-schema
prints the JSON-formatted layout configuration to stdout
I don't imagine I'd need this that often but just because I don't write custom layouts in
.twm.yaml
files that often I sometimes forget the exact format.--print-bash-completion
,--print-zsh-completion
,--print-fish-completion
prints the respective completion code to stdout
can be used to setup completions manually or by packagers (as is done in this flake) to install the completion files with
twm
. Adds completion! Pretty self explanatory. Seeing the little completion popups in my terminal fortwm
just makes me happy--print-man
prints man(1) page content to stdout
same as above, can install the man page manually or have it be installed with the package. this repo's flake does these for you so if you install
twm
via nix+this flake there is nothing to set upFlake
Updates the Nix dependencies & packages the man pages & shell completions with the binary