about Ex-Terminal

Post Reply
SamC
Posts: 207
Joined: 12.08.2023 00:49

about Ex-Terminal

Post by SamC »

Hello,
I notice that we can add Several Ex-Terminal on cuda-text
1.Is it possible to make 2 different shell types. Like Ex-Terminal1 using **.exe and Ex-Terminal1 using ***.exe.
2.How to make the **.exe in Terminal as admin,it seems it start as user type and some operation is limited.
3.I've tried to add folder on cuda/py folder to attempt to add new packages,but some packages doesn't work. It seems a little hard to handel the dependent relationships and version issues when didn't use pip command to install packages.
Thanks!
(it seems the abbreviation for command window exe can't be submitted,then I used ** to replace it above)
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

1. it is not possible in plugin.
2. it is not possible too. maybe you can create the patch.

3. when you copy some Python package to the 'py' dir, you must resolve all its dependencies, ie copy all dependent python modules to the 'py' too! to find which modules are dependencies, I usually download the package's zip file from PyPI.org and look into its text-information in the zip file.

method 2. call PIP for the standalone Python installation (on Windows). PIP installs the module + all dependencies. then I can look into folder 'site-packages' in the Python dir, and copy all appeared folders from there, to Cud's 'py' dir
SamC
Posts: 207
Joined: 12.08.2023 00:49

Post by SamC »

Thanks!
1.For method 2,as the python version in Cuda is 3.8.16,and my python is 3.9,should I install another version of 3.8.16?Or the version difference is little and the packages used are almost same?
2.If I copy many packages to cuda/py folder,will it slow down the speed of CudaText? CudaText is rather fast now,I don't want to slow it down~
3.How to make a user defined hotkey for certain string,like when I press Ctrl+1,"hello world" will be inserted into the window?
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

1. version difference is little and the packages for 3.9 maybe fit for 3.8. for python codes, it is so. for binary DLL codes (*.pyd or *.dll files) it's not so.

2. the slowdown will be visible only if you copy lot of folders (50+). and only in plugins calling. eg snippets expansion is the Snippets plugin.

3. you need the small plugin. experiment with "Plugins / Make Plugin". in the appeared 'run' method of new plugin:

x,y,x1,y1 = ed.get_carets()[0]
ed.insert(x, y, 'hello world')

then in the Command Palette find your new command and press F9 to set hotkey.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Post by SamC »

That's really convenient! For simulate keyboard operation,which method should be used? like use ctrl+1 to simulate F5? Please provide a link for ed module syntax description.
Thanks!
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

1. you cannot simulate F5 by Ctrl+1 because F5 don't have the action by default.
but if it has the action, eg some plugin is attached to F5, then attach Ctrl+1 as the SECONDARY HOTKEY to the same plugin action (F9 in the Command Palette shows hotkey config).

2. when i wrote
in the appeared 'run' method of new plugin:
x,y,x1,y1 = ed.get_carets()[0]
ed.insert(x, y, 'hello world')
I mean that plugin's file __init__.py must be like this:

Code: Select all

import os
from cudatext import *

class Command:
    
    def run(self):
        x,y,x1,y1 = ed.get_carets()[0]
        ed.insert(x, y, 'hello world')
you must place files
__init__.py
install.inf
to the 'py/cuda_my_plg_name' folder. both files (examples) are generated by command "Plugins / Make plugin".
SamC
Posts: 207
Joined: 12.08.2023 00:49

Post by SamC »

main Alexey wrote:1. version difference is little and the packages for 3.9 maybe fit for 3.8. for python codes, it is so. for binary DLL codes (*.pyd or *.dll files) it's not so.
Thanks!Is it possible to make a plugin in the further to manage the packages in Cuda directly,like call/use pip to install certain package to Cuda directly?
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

no, we cannot manage packages in the Cud using PIP. you must manage codes in the Python folder and copy folders by hands to 'py' dir.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Post by SamC »

SamC wrote:1.Is it possible to make 2 different shell types. Like Ex-Terminal1 using **.exe and Ex-Terminal1 using ***.exe.
Today,I notice we can add Terminal plus or Terminal plugin to appoint to another *.exe. Is it a possible solution?
For python,is there any plugin used to debug file and monitored variable,can Terminal plus do this?
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

maybe 2 different Terminal plugins (ExTerminal + TerminalPlus) is a solution, but I did not try this.

>is there any plugin used to debug file and monitored variable,can Terminal plus do this?
no, we don't have debugger plugins, sorry.
Post Reply