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

feat(terminal): add toggle_all() function #421

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ollema
Copy link

@ollema ollema commented Jan 5, 2025

Description

I am enjoying the terminal plugin quite a lot - but when I worked with more than one terminal I found it annoying to have to close all terminal windows one by one and then reopen them one by one.

This PR adds a toggle_all() function to terminal.lua which opens all closed terminals (if any) or closes all opened terminals (if any). If no terminals have been opened, it will default to opening a new one (similar to the get() function).

Maybe this could be implemented in userland but I could not find a nice way to do that. It also helps a lot to have access to the terminals variable!

Let me know what you think!

Screencast

In the following screencast I first toggle terminal 1 and then I toggle terminal 2.

I then use the newly added toggle_all function to close and open both terminals with the Ctrl-\ keybind.

Screen.Recording.2025-01-05.at.13.00.06.mov

@ollema ollema changed the title add toggle_all function to terminal.lua feat: add toggle_all() function to terminal.lua Jan 5, 2025
@ollema ollema changed the title feat: add toggle_all() function to terminal.lua feat(terminal): add toggle_all() function Jan 5, 2025
@ollema ollema changed the title feat(terminal): add toggle_all() function feat(terminal): add toggle_all() function Jan 5, 2025
@ollema
Copy link
Author

ollema commented Jan 6, 2025

uh I have no idea why that bot decided to nuke my change, I probably misunderstood how to configure that in my fork. removed the app now and force pushed the actual change

@ollema ollema force-pushed the main branch 2 times, most recently from ddaefd2 to f0c2d38 Compare January 15, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant