Code Monkey home page Code Monkey logo

Comments (14)

Civitasv avatar Civitasv commented on August 15, 2024 2

Okay, feel free to improve it 😄

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024 1

I've supported toggleterm as an executor or runner, just set executor or runner to toggleterm should be fine.

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024

Now, toggleterm is supported using the overseer, have you tried it?

Edit: add configuration

      cmake_executor = {             -- executor to use
        name = "overseer",           -- name of the executor
        ...
        default_opts = {             -- a list of default and possible values for executors
          ...
          overseer = {
            new_task_opts = {
              strategy = {
                "toggleterm",
                direction = "horizontal",
                autos_croll = true,
                quit_on_exit = "success"
              }
            },   -- options to pass into the `overseer.new_task` command
            ...
          },
          ...
      },

from cmake-tools.nvim.

deeedob avatar deeedob commented on August 15, 2024

Yes, i've tried it but I don't need another plugin (which I won't use) just for getting the output there. I would prefer a direct integration :)

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024

I understand. You can define a new executor/runner in the plugin. See the source code of overseer, quickfix and terminal to get some idea. It should not be that hard.

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024

Someday I may expose the definition of executor/runner as API so users can define their owns.

from cmake-tools.nvim.

deeedob avatar deeedob commented on August 15, 2024

I understand. You can define a new executor/runner in the plugin. See the source code of overseer, quickfix and terminal to get some idea. It should not be that hard.

I'll try something out in the following days, thanks.

Someday I may expose the definition of executor/runner as API so users can define their owns.

Yeah, that would be cool :)

from cmake-tools.nvim.

deeedob avatar deeedob commented on August 15, 2024

Oh damn :D I was just about to push my version. Good job and thanks! I'm currently on it to improve it just a little bit and add some more features :)

from cmake-tools.nvim.

deeedob avatar deeedob commented on August 15, 2024

Okay, I've been improving it quite a bit. As e.g. running separate or unified terminals and also tracking the cmd finish accurately. I was a bit surprised about the chan_id property you've set and how you tracked the end of the cmd in general as on_exit will get invoked only if you start the terminal with the cmd and otherwise on shell exit. Anyway have a WIP patch here. Still need to fix some edgecases and create a PR then :)

from cmake-tools.nvim.

athanase avatar athanase commented on August 15, 2024

@Civitasv works great for me except that the command passed to toggleterm seems to contain unwanted parts:

/home/code/test/build/clang-17_mold/Debug/bin/test 
exit $? 

When the command finishes, exit$? is then executed by my shell.

Running separate or unified terminals would be really helpful @deeedob

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024

Yes, the ‘exit $?’ is used to stop the shell process. For reference, I kinda copied them from overseer.nvim.

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024

Okay, I've been improving it quite a bit. As e.g. running separate or unified terminals and also tracking the cmd finish accurately. I was a bit surprised about the chan_id property you've set and how you tracked the end of the cmd in general as on_exit will get invoked only if you start the terminal with the cmd and otherwise on shell exit. Anyway have a WIP patch here. Still need to fix some edgecases and create a PR then :)

Great to hear!
And currently each cmd is executed using a separate shell process. After the command finish, we use exit $? to stop the shell process, then, the on_exit function will be executed.

from cmake-tools.nvim.

deeedob avatar deeedob commented on August 15, 2024

Ahh yeah, I see. I wanted to go with a different approach since I (personally) like it more if the shell stays 'active' e.g. just sending the cmd and then tracking the execution of it.

from cmake-tools.nvim.

Civitasv avatar Civitasv commented on August 15, 2024

I understand, actually our plugin’s terminal implementation(though kinda buggy) follows this idea, it is unified.

from cmake-tools.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.