Is there any way to execute a single LINE of code in a code block ?

Home Forums cherrytree Is there any way to execute a single LINE of code in a code block ?


Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #126046

    Context: I am trying to use Cherry Tree to hold setup and installation information for my Linux PC. The information comprises a mixture of notes and shell commands. It would be really useful to be able to point to single or multiple lines of code and then execute them. I know you can execute code blocks, but I might have a lot of commands in a single code box, as it is tedious to set up individual boxes for each line.

    Is it already possible to do this, and if so how ?

    This feature would be great for any language with ‘line’ oriented syntax.


    Just to clarify requirements, do you hope to select a single line command from a list of commands listed in each CodeBox?

    There is an old now unsupported tool CLI Companion in Ubuntu for this purpose but I do see an advantage in mixing CherryTree CodeBoxes with Notes, for example in a migration workflow.

    My first thoughts are to parse the content of the selected CodeBox using external Python script to analyse line by line and run selected line.


    Yes, set ups normally consist of a lot of single line shell commands. Normally the process is not so well defined as to be written as a single executable script. Normally I have to step through manually and adapt it a bit on the fly (software is forever changing due to continual new versions). I will choose which commands to execute, sometimes editing them first.

    It would be convenient to have a cursor in the code block and a hotkey which executes the command on the current line in a command shell (showing the results).

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.