Germinal - a terminal with some potential

So you have written that new, must have program. Let us see it here.
Post Reply
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Germinal - a terminal with some potential

Post by BruceSteers »

Germinal
A gambas terminal application (bash)

Main Features..

* Bookmark folders and use the bookmarks to either cd the dir or input the text
* Customize look, Color, transparency, font
* Show bash history in a searchable list. (see snapshot)
* Edit current command line in a TextEditor
* Select/Delete current command line.
And the most recent addition and a very handy thing...
* Navigate the cursor using arrow keys while holding Ctrl (left and right move to next space, up and down move line)
Video clip of cursor movement https://youtu.be/QBhxohum3AQ
* Create custom commands to edit command line/selected text
Attachments
Germinal-1.0.9.tar.gz
(276.97 KiB) Downloaded 2 times
Untitled.jpg
Untitled.jpg (65.72 KiB) Viewed 2468 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Germinal - a terminal with some potential

Post by BruceSteers »

Btw. there's some bugs in gb.form.terminal that i'm reporting and hopefully Benoit can find a fix.

Basically do not resize the terminal when there is a long command line present.
It seems okay with short command lines but if there is a long command (more than one line) then resizing the terminal will make things go all weird.

also if you type say 'echo -n "Hello"' then there is no newline so the prompt is not on Column 0 , pressing up arrow to cycle through history will also go a bit odd for a moment. it seems the terminal sets the prompt to column 0 and renders the text at normal position but the TerminalView display does not correct for this for a couple of hits. (then it seems to adjust)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Germinal - a terminal with some potential

Post by BruceSteers »

This program is also still a bit WIP

I have been using it for a long time and it's fully functional but the recent cursor movement addition was so awesome i had to upload it to the world right away. (i probably should have fully tested/debugged it first)

The custom command menu does not work and is still in development.

I'm slowly getting it ready. as a test i am firstly working on a function i want to add as a custom command...

Now you can press Ctrl+4 and it will either insert $() with the cursor between the brackets or if any text is selected it will put the selected text inside $() then put cursor back where it was.

I made a CommandLine.class that can get the current command line text and cursor position and then restore it,
I now use this for the cd menus/buttons. when you click a bookmark or cd button it clears the current command line, runs the cd command to change dir, then restores the command line/cursor position so a directory can be changed seamlessly and not affect your command.

Ctrl+A now selects the command line text only not all terminal text.
Ctrl+Shift+A selects the whole terminal text

latest commits will be here https://gitlab.com/bsteers4/germinal
I'll update the archive in the first post....
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Germinal - a terminal with some potential

Post by BruceSteers »

I've just created a development branch on gitlab so i can test things there before merging to main and keep the revision raising to a min.

I've just ironed out some bugs in the new routines. : :roll:

I have made it so changing prompt line from showing full path to only folder also restores the command line.

V 1.0.4

Now to get working on the custom command feature :)
Current theory is to have the following...
Custom commands will be a sequence of events you can add of a particular type.

The types will be a choice of the following...
* directly insert the entered text.
* run as command/script and insert output.
* Key controls left, right, up, down, backspace, delete with a value and also home & end

The commands will be able to use placeholders
* $(Text) for All the command text
* $(SelectedOnly) for the selected text or nothing if nothing is selected
* $(Selected) for selected text or the whole command if no text is selected.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
PJBlack
Posts: 188
Joined: Tuesday 9th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Germinal - a terminal with some potential

Post by PJBlack »

hai bruce,

you may should disable the selection of proportional fonts and just show monospaced ... cause its very ugly ;-)

micha
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Germinal - a terminal with some potential

Post by BruceSteers »

PJBlack wrote: Thursday 18th April 2024 1:15pm hai bruce,

you may should disable the selection of proportional fonts and just show monospaced ... cause its very ugly ;-)

micha
Probably a good idea. Cheers :)

How do you like it though?

Used Ctrl to move the cursor yet? I'm loving that feature, it makes things like editing a paste of the gambas dependency lists sooooo much nicer :)
there's no other terminal like it :D

I've set "Fixed fonts only" now in the first posts archive :)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
PJBlack
Posts: 188
Joined: Tuesday 9th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Germinal - a terminal with some potential

Post by PJBlack »

working a lot with terminal and i like it so far :-) ... as usual nice proggy from you ;)
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Germinal - a terminal with some potential

Post by BruceSteers »

Finally got custom commands working.
It's a bit complex.

From the readme...

Making custom commands...
You can create commands to manipulate/edit the current command line.
Commands are made of sequences of either scripts or key commands.
Select the custom command editor from the menu to open the editor.
Press the Add button to add either a script or key sequence.

Add a Script:

Add a bash or gambas script. input the script into the editor.

Tokens can be used in the script for the following data..\

$(Text) = The whole command line (quoted)
$(Selected) = Selected text (or whole command line) (quoted)
$(SelectedOnly) = Selected text (or nothing) (quoted)
$(Cursor) = Cursor position
$(SelectStart) = Selected text position


There are 4 choices of what to do with your script output...

Ignore ; do nothing with the command output.
Insert at cursor position
Overwrite selected text ; replaces selected text
Overwrite command; replace the whole command line.


Add key sequence...

choose from the following selection of key commands.\
(all commands that take a value default to 1 if no value is given)

Delete=n ; Delete n chars to right (default is 1)
Backspace=n ; Delete n chars to left
Left=n, Right=n, Up=n, Down=n ; Move n spaces Left/right/up/down
Home ; Move Home
End ; Move End
Copy ; Copy selected text
Paste ; Paste clipboard
Cursor=n ; Position cursor
UnSelect ; Clear selection
RestoreCursor ; Put cursor back where it was


So as seen in the snapshot you can add commands using the list on the left.
After adding use the top right Add button to add either a command or a key sequence
use the Tokens button to see the choices of tokens.
use the TextEditor to edit commands/key sequences
use the terminal below to test the commands.
Attachments
Untitled.jpg
Untitled.jpg (68.94 KiB) Viewed 46 times
If at first you don't succeed , try doing something differently.
BruceS
Post Reply