Page 1 of 1

ExTerminal plugin

Posted: 05.07.2022 19:30
by main Alexey
Plugin for CudaText.
Advantages over Terminal+ plugin: ExTerminal tries to mimic real interactive terminal behaviour.
That means that you can use apps like nano/vim/htop/python inside it.
Plugin doesn't give separate input field as in Terminal+.

To configure, call menu item in the "Options/ Settings-plugins / ExTerminal" to edit config file plugins.ini. Options are in section [exterminal], boolean values 0/1.

Options:
- colors: display colors in terminal. Working slow as for now. Disabled by default
- esc_focuses_editor: focus editor by pressing ESC key instead of sending it to terminal.
Disabled by default.
Hint: Ctrl+[ key sends ESC code to the terminal, you can use it instead of ESC key.

Author: veksha (https://github.com/veksha)

plugin.ExTerminal current line background color

Posted: 27.05.2024 06:05
by SamC
After setting the current line BG color of editor,it is found that the BG color of ExTerminal is also changed to that.
How to keep it unchanged.
Thanks!

ExTerminal
S2024-05-27-13-59-23.png

Re: plugin.ExTerminal current line background color

Posted: 27.05.2024 06:14
by main Alexey
seems you use NOT the last plugin version.
last one has code to disable the cur-line-highlight:

self.memo.set_prop(PROP_HILITE_CUR_LINE, False)

update the plugin and try again.

Re: plugin.ExTerminal current line background color

Posted: 27.05.2024 07:04
by SamC
main Alexey wrote: 27.05.2024 06:14 seems you use NOT the last plugin version.
last one has code to disable the cur-line-highlight:

self.memo.set_prop(PROP_HILITE_CUR_LINE, False)

update the plugin and try again.
Updated and issue is solved.
Thanks!

ExTerminal plugin: help to improve the code

Posted: 29.05.2024 16:06
by jcfaria.uesc
Hello,

I'm studying Python and trying to make some improvements to the ExTerminal plugin, as it was what I found closest to my needs.

There is a variable

Code: Select all

opt_show_caption = False # Line 40 of __init__.py
which defines whether the name of the program connected via pipe by the plugin (Python, R, Rterm, etc.) will be displayed (or not) in the caption of the ExTerminal panel.

I want to make a (clean) intervention in the local variable "fn" based on the name of the connected application or the caption displayed on the ExTerminal panel.

Code: Select all

 #NOTE: run_current_file
 def run_current_file(self):
     fn = ed.get_filename()
     
     #-------------------------------------------------------
     if "program name or terminal caption" == "XXX"
         fn = fn.replace('\\', '/') #NOTE: J.C.Faria
     #-------------------------------------------------------
     
     if fn:
         t = self.get_active_terminal()
         if t:
             self.show_terminal(t)
             t.write('source("' + fn + '")\r') #NOTE: J.C.Faria
 
Due to my limitations in Python (I'm still studying) and the complexity of the plugin code, I'm trying but I'm not able to find a way to find the program name or caption displayed in the ExTerminal panel.

I believe that as I study Python and study the plugin's source code more, I will need less help from more experienced developers.

Any help is welcome...

Re: ExTerminal plugin: help to improve the code

Posted: 30.05.2024 07:19
by main Alexey
If you want to read the current caption of the Terminal form (dialog w/o borders), you can call dlg_proc() with proper form's handle and action DLG_PROP_GET. it will return dict with several fields.

Re: ExTerminal plugin: help to improve the code

Posted: 30.05.2024 07:28
by main Alexey
This code from py/cuda_exterminal/memoscreen.py changes the header:

Code: Select all

    def set_title(self, param):
        super(MemoScreen, self).set_title(param)
        dlg_proc(self.h_dlg, DLG_PROP_SET, name='form', prop={'cap': param})
        dlg_proc(self.h_dlg, DLG_CTL_PROP_SET, name='header', prop={'cap': param})
I did not find where this set_title is called.
maybe it is called in inherited class.