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

Question. Reuse terminal to execute new command #573

Open
daniilrozanov opened this issue Apr 21, 2024 · 0 comments
Open

Question. Reuse terminal to execute new command #573

daniilrozanov opened this issue Apr 21, 2024 · 0 comments

Comments

@daniilrozanov
Copy link

I am writing plugin, which can build project. Looks good to use toggleterm as environment to run build command. I don't want to allow user to execute any other commands but build, so i create terminal as

local cmake_build = Terminal:new({ cmd = "cmake --build ...", --[...]-- })

But, when building is done, user may want to build project again. I don't want to delete this terminal and open new one, since it requires for me to throw old terminal's size to new one and other boilerplate. Is it possible to kinda reinitialise terminal keeping same window, buffer and other it's parameters, except cmd, env and other i want to update. Or, maybe, it is possible to attach new terminal to old terminal's buffer, deleting the old one?

I still haven't fully decided how best to solve this problem, so I'd be glad to know about the method I'm missing. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant