-
Notifications
You must be signed in to change notification settings - Fork 466
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
Code Execution: All commands into one shell window; integrated shell pane; any-line-exec; capture output #1772
Comments
I use Geany too, surely there is room for improvement in Cherrytree. |
Except for the dedicated capture of the output, this is done and will be in the upcoming version that shall be released in about a week. Unfortunately the library does not support Windows at the moment so the integrated terminal is available only in Linux and Mac OS. |
Wow! Soooo wow! Can't await to get that release. Thanks so much for implementing this! |
Hey giuspen! Thanks for implementing this, great job! Just tested a bit. What I found is that it's good for local execution of commands, i.e. on the cherrytree machine. However, often (way more than locally...) I do things via ssh on remote machines, so the first thing is to log in via ssh in the integrated terminal, and then run subsequent commands (by running selected lines from my notes) in that ssh session. This does not work however with the way cherrytree does it, as the command to be exec'd is written into a local(!) tmp file and than that is executed in the embedded terminal - which being "on the remote host" of course complains as it can't find the local tmp script file. Bummer. |
Hi Radoom what you ask should be easily feasible for the shell, and maybe for scriptable languages as well, I'll have a loo |
… the terminal rather than in a temporary file (#1772)
I did it, it will be available in 0.99.52 but if you would like to test it before it would be a useful feedback. |
Sorry only got to upgrade to 0.99.52 today - works perfectly! So much thanks!!!! One more tiny bit I found: currently there's a menu item (+key combo Ctrl+Tab) "view > Toggle Focus Tree/Text". Sometimes, one needs to get into the terminal ... without touching the mouse ;-)... f.i. to enter a password after calling a ssh command, or to start editing in the nano instance called up in the (remote) terminal session... Current work-around: Ctrl+F9 to toggle terminal OFF, and again Ctrl+F9 to toggle terminal ON again => Cursor is then in the terminal. Glad I found out for now ... Nice thing is that the terminal does not get re-set by this, so it should work in most cases just fine. A dedicated "jump forth and back" key would be more intuitive though. One could also make Ctrl+Tab cycle through tree, text, and terminal panes. (And maybe "Ctrl-Shift-Tab" to cycle the other direction.) Similar to Excel I think, where it cycles through open files IIRC. But having a dedicated command as above would probably be easier and better. |
I thought about moving the cursor and as you found the idea was exactly to hit twice Ctrl+F9 but I know may not be immediate to everyone. |
…rminal with default shortcut Ctrl+Shift+T (#1772)
I added the action to toggle focus between text and terminal, default shortcut Ctrl+Shift+T |
P-E-R-F-E-C-T ! Thank you so so much! |
Quick question. Is there a way to specify which shell to run? I tried going to File > Preferences > Plain Text and Code > then scrolled all the way down and for sh entered /usr/bin/zsh. Then I restarted Cherry Tree, but it was still using the regular shell prompt. I have Oh My Zsh configured for the ZShell terminal and it works as expected when I start the terminal outside of Cherry Tree. |
Hm, somehow it does not see it after applying your suggestion and restarting. |
For some reason the library https://gitlab.gnome.org/GNOME/vte seems to be not happy with /usr/bin/zsh |
I think I figured out the problem. Cherry Tree is installed via Flatpak and that comes with certain limitations, like read-only. However, when run this from a regular terminal: Running the symbolic link creation command from a regular terminal returns: I think that if I install Cherry Tree manually, or not using Flatpak, it will work. |
I'd like to propose four points about the code execution, to some extend inspired how it is done in Geany (excellent editor!)
1. All in one terminal window:
Execute all commands in the same terminal window.
At the moment, cherrytree opens a new xterm for every command I run. Am I overlooking an option, is this configurable somewhere already?
2. Integrated shell pane:
I'd prefer to have the terminal embedded in cherrytree's window like the editor Geany does (using libvte-2.91-0). Then, have a F-key to jump between the text node editing pane (F2 in Geany by default) and another to jump to the terminal (F4 in Geany).
And of course have this combined with number 1 above.
3. Execute any line or selection:
Make it possible to execute any line or selected text like Geany does. There, you can exec any line if the cursor is in it an nothing is selected; if something is selected, that selection gets executed. Why? When writing howtos / logging how I get something sorted, I have lots of one-liners in between my notes, and got used to format them as "monospace" with a simple shortcut instead of having lots of codeboxes. I use codeboxes more to have the output formatted than the actual command.
4. Auto-Capture command output:
As suggested elsewhere: capture the output of the terminal (stdout?) into a dedicated box below the executed line; this would ideally be automated by a "modifed exec" command like so:
a) The current way: F5 to run the command in the terminal without getting the output back.
b) Modified like Shift+F5: run the command, capture the output, and put the output into an auto-generated text-box inserted automatically on the line below the executed command / code box.
That way user can choose by a simple (different) key combo whether to have or not to have the result in his note.
The text was updated successfully, but these errors were encountered: