Skip to content
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

Add section on how to spawn vim from a ratatui application #406

Open
kdheepak opened this issue Jan 29, 2024 · 2 comments
Open

Add section on how to spawn vim from a ratatui application #406

kdheepak opened this issue Jan 29, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kdheepak
Copy link
Contributor

  • You need to disable_raw_mode and exit alternate screen
  • You need to pause the event loop (if you have one) that handles any key or mouse events
  • You can then spawn vim
  • Once vim returns after wait(), you'll need to resume the event loop (if you have one)
  • You'll need to enable_raw_mode and enter alternate screen again.

Example of how to do this with an async event loop:

https://github.com/ratatui-org/templates/blob/b75771463c00088b75e90986979c60720d024bbf/component/template/src/tui.rs#L171-L198

@kdheepak kdheepak added enhancement New feature or request good first issue Good for newcomers labels Jan 29, 2024
@Valentin271
Copy link
Member

I believe this should be about the same for any other TUI: lazygit, yazi, even bash.

Also one important thing to note, this is about spawning a program and gaining back control. Which is different (and somewhat harder) than spawning a program on end.

Otherwise +1 for this.

@kdheepak
Copy link
Contributor Author

Related: kdheepak/taskwarrior-tui#46

orhun added a commit to orhun/rattler-build that referenced this issue Mar 16, 2024
wolfv pushed a commit to prefix-dev/rattler-build that referenced this issue Mar 20, 2024
* feat: create a TUI
* refactor: restructure library for accommodating TUI needs
* feat(tui): build package when enter is pressed
* fix: remove the application name
* fix: initialize logger for non-tui subcommands
* refactor: offload spinner handling to throbber-widgets-tui widget
* feat: use tail behavior for logs
* refactor: apply clippy suggestions
* feat: support mouse scrolling
* feat: support mouse clicks for starting build
* refactor: add tui feature
* fix: update import
* chore: update Cargo.lock
* refactor: use build output in TUI
* chore: add new line to build variant logs
* chore: panic on resolving packages
* refactor: fix selecting multiple packages
* refactor: create build directories before build
* refactor: use events while resolving packages
* refactor: simplify setting up the directories
* chore: remove timestamp from TUI logs
* fix: disable building packages at the same time
* fix: fix the scrollbar position for new lines
* refactor: use a single package for multiple outputs
* fix: fix scroll issues
* style: make TUI prettier
* feat: handle build errors in TUI
* feat: add key bindings for the TUI
* feat: support horizontal scrolling in TUI
* chore: add extra space for logs just to be safe
* feat: supporte editing recipe via TUI
* refactor: apply clippy suggestions
* refactor: use the recipe path for build output
* refactor: rename tui util module to utils
* fix: fix switching to input mode
* fix: cancel the event loop when launching editor (ratatui-org/ratatui-website#406)
* chore: implement Debug for BuildOutput
* feat: process build outputs separately for TUI
* feat: support building subpackages
* chore: log the invalid command
* fix: fix the package selection in TUI
* style: use package identifier in the TUI list
* style: render the package identifier when there is enough space
* docs: add rattler-build-tui documentation
* docs: fix admonition syntax
* docs: update key bindings style
* docs: move TUI docs to website
* docs: update wording
joshka pushed a commit that referenced this issue Jun 4, 2024
* test(span): add some tests for "Span"

* feat(span): replace all "From<*>" with one "From<Into<Cow>>>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants