Closed khris190 closed 5 months ago
From https://github.com/Civitasv/cmake-tools.nvim/issues/145#issuecomment-1713694078
The design purpose of our own terminal is to provide a unified location for executing commands, so we can persistent env vars, store all commands that have been executed, give full access to the user (users who do not use CMakePresets) to set/modify specific cmake flags, support stdin, etc. The core idea is: when there is a terminal, we don't make a new one.
I don't know how to implement on_exit
for this unified terminal, so I introduced full_cmd
variable.
that makes sense, i could try to implement it with screen command but it wouldn't work on windows without cygwin
or and i'm not proud of this idea but w/e
We could just write a lockfile when the command is run and add to end of every command ; rm {lockfile}
with a coroutine checking if that file exists to execute on_exit with defer_fn
i know You probably thought of most of the options but it just doesn't let me sleep
or and i'm not proud of this idea but w/e We could just write a lockfile when the command is run and add to end of every command
; rm {lockfile}
with a coroutine checking if that file exists to execute on_exit withdefer_fn
This maybe feasible.
i know You probably thought of most of the options but it just doesn't let me sleep
Don'r rush, take your time.
this one might require some changes so take Your time reviewing it because i might have broke some option that i didnt even know existed
&& ${SHELL}-bash
to the end of the command but then i feel like toggleterm should get this option toohas_active_job
because while trying out the "ps command pulling" method for on_exit i saw that bash has about 50-150ms downtime when running compound commands with&&
,;
or||
when it just says that terminal doesnt have any children and in this implementation there is no need to check for childrenprepare_cmd_for_execute
andprepare_cmd_for_run
i feel like we should move all runners to the directory and create utils of them or even go for inheritence and create a base_runner that will contain those commands and run them inutils.run
andutils.execute
wrap_call
should be depricated and changed intocmd_prexif
and addcmd_postfix
, but that's just my feeling