U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » UppHub » A terminal emulator widget for U++
A terminal emulator widget for U++ [message #51415] Sat, 23 March 2019 22:31 Go to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

tl;dr: I am going to publish a terminal emulator widget for U++, in the following month (April).

From the user POV, it is a very simple Ctrl that can be embedded in any U++ applications via traditional U++ way: (E.g. Add(terminal.SizePos())
And it has a very "thin" public api.
Also its page and parser components are completely decoupled, and documented, and can be used seperately in any project (Read: You can write your own terminal emulator that suits your need with ease).

Before I publish it, I'd like to know what features you would like to see in it.

Currently it is more capable than Win10's new ANSI console.


At the moment it supports:
- VT52/ANSI/1xxx/2xx and -partially- 4xx/5xx emulation and Xterm extension.
- Both 7-Bit and 8-Bit modes.
- UTF8
- OCS and DCS
- ANSI colors
- Alternate screen buffer. 
- Resize


Planned:

- Copy-paste support
- Scrollback buffer
- Mouse support
- And various optimizations.



I will also publish two reference examples with it: a simple terminal emulator constructed with Terminal widget, and a remote terminal to demonstrate SSH integration.

A screenshot is much more meaningful than words.
(On a humble test setup (Linux 5.0/Gnone/relatively old test AMD machine. Top row: Nano editor, AnsiArt, Vttest. Bottom row: Emacs, Top, RadeonTop).

index.php?t=getfile&id=5789&private=0

Best regards.
Oblivion


[Updated on: Sat, 23 March 2019 22:35]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #51422 is a reply to message #51415] Sun, 24 March 2019 16:15 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Maybe a sample of it could be a kind of new Putty.
Putty is so basic that with any feature you would add, yours would be better. And in U++ Smile


Best regards
Iñaki

[Updated on: Sun, 24 March 2019 16:16]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #51444 is a reply to message #51422] Tue, 26 March 2019 10:02 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello Koldo,

Quote:
Maybe a sample of it could be a kind of new Putty.
Putty is so basic that with any feature you would add, yours would be better. And in U++


Sure. Currently a barebone SSH terminal example (with the upconing Terminal ctrl), and TERM variable set to "xterm") in U++ is 52 lines of code. (Single file, password authentication).


What I have also in my mind is VirtualGui integration. Smile

Think about accessing to your server or machine via a terminal running on web browser with SSL, on-demand.

This would be a very cool and (somewhat unique?) feature. And it's high on my TODO list. Smile


Best regars,
Oblivion


[Updated on: Tue, 26 March 2019 10:06]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #51448 is a reply to message #51422] Tue, 26 March 2019 13:11 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
And here it is. It took five minutes. We now have terminal access over web browsers, using TURTLE Smile
It works as expected.

This is the problem with U++: It is so good yet so underrated. :/


Screenshot:

index.php?t=getfile&id=5793&private=0

Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #51449 is a reply to message #51448] Tue, 26 March 2019 13:21 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Laughing

Best regards
Iñaki
Re: A terminal emulator widget for U++ [message #51462 is a reply to message #51448] Wed, 27 March 2019 23:14 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
Oblivion wrote on Tue, 26 March 2019 08:11
And here it is. It took five minutes. We now have terminal access over web browsers, using TURTLE Smile
It works as expected.

Are you able to run a Release version of your terminal emulator using TURTLE?
I'm asking this because I'm unable to run a Release version of WebWord (a demo app).


Regards,
Novo
Re: A terminal emulator widget for U++ [message #51463 is a reply to message #51462] Thu, 28 March 2019 08:01 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello Novo,

Quote:

Are you able to run a Release version of your terminal emulator using TURTLE?
I'm asking this because I'm unable to run a Release version of WebWord (a demo app).


Yep, it works on Linux on localhost:8088 with latest versions of U++, gcc. I have yet to test it (Turtle build) on CLANG or Windows.

Setting the Ctrl::host to localhost was sufficient.

The only problem I encountered was the loss of caret due to losing focus.

Best regards,
Oblivion


[Updated on: Thu, 28 March 2019 08:20]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #51465 is a reply to message #51463] Thu, 28 March 2019 16:57 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
Oblivion wrote on Thu, 28 March 2019 03:01

Setting the Ctrl::host to localhost was sufficient.

Thanks a lot!

I didn't realize that Ctrl::host is used to connect back from JavaScript to a server.
I still have several problems like I cannot create more than one connection, although Release configuration is forking. And WebWord is using 100% of CPU because it is spinning in a connection loop which doesn't have any timeouts.

Are you experiencing the same problems or is it something related to my web-server setup?


Regards,
Novo
Re: A terminal emulator widget for U++ [message #51468 is a reply to message #51465] Thu, 28 March 2019 19:21 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Quote:

Are you experiencing the same problems or is it something related to my web-server setup?


Yes, after you've pointed out, I've checked the behaviour and it is indeed eating a lot of CPU cylcles (On Linux 5.0, GCC, release mode, AMD ryzen) I get 16% cpu usage in idle state).

Good news is I found a possible candidate and a workaround (or fix maybe?) but Mirek should see it first.

İn Turtle/Server.cpp, method StartSession(), the for loop in between ln 75-123 (where the server is waiting for connections) seems to be the problem:

A simple workaround or a possible fix is to call Sleep(10) in ln: 75.

E.g.
for(;;) {
	if(quit)
		return false;
	Sleep(10);	// Let's eat less CPU cycle while waiting for connections.
//...



OTOH, there are also bad news:

1) It ssems impossible to open multiple clients at once (at leasy on Firefox (latest).
Symptom: When trying to open a second connection to turtle server, tab immediately closes (yet a second webword process runs in the background!).
2) I've noticed a potential security flaw: Closing the client using the client's "close window" button does not clear the browser tab (or canvas). It should. Or else sensitive data may be visible.


Best regards.
Oblivion


Re: A terminal emulator widget for U++ [message #51517 is a reply to message #51415] Mon, 08 April 2019 11:45 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
As the day that I'll publish the code on my github repo draws closer, final bits for the first version of TerminalCtrl are coming together well.

- Scrollback buffer is implemented.
- Chameleon (theme) support is implemented.
- VT52/1xx/2xx keyboard (with function keys) support is implemented.
- Conformance levels support is added (i.e. it is now possible to restrict the operation level to e.g. VT52, VT102, or VT220 etc.)


Here is a screenshot.
On the left is our SSH package/SshShell (running in console mode) running on TerminalCTrl, with scrollback buffer enabled.
In the middle is TerminalCtrl running with the widely used "Solarized theme"
On the right is the mighty emacs, with dropdown menus and function keys on default theme.

index.php?t=getfile&id=5798&private=0


Suggestions are welcome.

Best regards,
Oblivion


[Updated on: Mon, 08 April 2019 12:24]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #51748 is a reply to message #51415] Mon, 13 May 2019 13:47 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Oblivion,

Very good job, it seems to be awesome.
I will try it on my Raspberry with TURTLE !

When do you think you'll publish it ? Embarassed

Thanks in advance,
Best Regard
Re: A terminal emulator widget for U++ [message #51752 is a reply to message #51748] Tue, 14 May 2019 09:57 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello Xemuth,
Xemuth wrote on Mon, 13 May 2019 14:47
Hello Oblivion,

Very good job, it seems to be awesome.
I will try it on my Raspberry with TURTLE !

When do you think you'll publish it ? Embarassed

Thanks in advance,
Best Regard


Terminal packaga is already delayed (initially I'd planned to publish it in April).
Good news is that the first version of the package is basiaclly complete. So it will be published at the end of this month.

Currently I am making some profiling and optimizations (which led to 37% performance gain and 30% less memory consumption on average.
Also, now the parser is a complete vt parser, i.e. it can handle every single VT instruction (not every command is implemented though) correctly from VT52 to Vt520)
I am testing it with vttest, xterm's and ncurses's test tools. And fixing some "paper-cuts" that I have noticed. Smile


Best regards,
Oblivion


[Updated on: Tue, 14 May 2019 09:58]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #51823 is a reply to message #51415] Sat, 08 June 2019 16:48 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A small but "big" update.

Terminal ctrl for U++ is on its way, and here is a short video preview:


https://vimeo.com/341085501


It is now mostly compatible with xterm.

-- Mouse tracking support added. Terminal can now handle mouse events if they are supported by the applications (See above video for example)
-- Bracketed paste mode added.
-- "G-sets" upport added. It now supports legacy applications that rely on font shifting (g0, g1, g2, g3, gl, gr).
-- DEC Technical charset is added.


Now I feel it is eligible for first release. (Probably next friday...)


P.s.: Terminal may seem sluggish in the video. (It is not.)
That's because I encoded it on my good old test machine, and I limited the framerate to 15.

Best regards,
Oblivion.


[Updated on: Sat, 08 June 2019 16:52]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52065 is a reply to message #51415] Sat, 13 July 2019 17:35 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

It's been a while since I posted any news about the Terminal package. I had to focus on my other works fo a while.

The good news is last week I implemented the final missing pieces for the 0.1 release:

- 256 colors support added.
- ANSI colors support added.
- XTerm dynamic colors suppport added.
- VT 4xx rectangular area operations are added (copy, invert, move, fill, in both selective and normal modes)
- UDK (DEC's user-defined function keys support) added.
- Lazy resize option is added (to reduce flickers on network terminals uch as SSH-based ones)
- Size hint added.
- A .usc file is added to the Terminal package. (The most common options (font, ink, paper, cursor, sizehint etc.) can be set using TheIDE's layout editor. Also it shows a size hint (in calculated cell size) to simplfy positiong the widget in the layout ediyor.
- It is also tested on Windows, and it works well. :)  (currently as SSH terminal, in the near future as a frontend for Windows power shell too) 


Two notes on the upcoming initial release:

1) Terminal package currently does not contain any external code/libaray. It uses U++, and it's plugins. Smile
2) Although a virtual terminal requires a pty device, and Terminal pacjage contains one, they are completely decoupled.
Terminal ctrl can be used and compiled without PtyProcess. This gives it a huge flexibility
In this regard I will provide 4 basic examples with the package:
- TerminalExample | Uses ptyprocess (currently ptyprocess requires POSIX-compliant operationg systems (or possibly cygwin on Windows.)
- TerminalExampleWithLayout | The same as above.
--------------------------------
- SShTerminalExample | Does not use PtyProcess. IT uses Core/SSH package isntead
- SshTerminalExampleWithLayout | The same as above.


Here is the actual code of TerminalExample (36 LOCs total):

#include <Core/Core.h>
#include <Terminal/Terminal.h>

using namespace Upp;

const char *nixshell = "/bin/bash";

struct TerminalExample : TopWindow {
	Terminal	term;
	PtyProcess	pty;

	TerminalExample()
	{
		term.WhenBell	=   [=]()		{ BeepExclamation(); };
		term.WhenTitle	=   [=](String s)	{ Title(s); };
		term.WhenResize	=   [=]()		{ pty.SetSize(term.GetPageSize()); };
		term.WhenOutput	=   [=](String s)	{ PutGet(s); };
		SetRect(term.GetStdSize());	// 80 x 24 cells (scaled).
		Sizeable().Zoomable().CenterScreen().Add(term.SizePos());
		SetTimeCallback(-1, [=]()		{ PutGet(); });
		pty.Start(nixshell, Environment(), GetHomeDirectory());
	}
	
	void PutGet(String out = Null)
	{
		term.Write(pty.Get());
		pty.Write(out);
		if(!pty.IsRunning())
			Break();
	}
};

GUI_APP_MAIN
{
	TerminalExample().Run();
}




Below was a sort of "final boss" for the first release. It shows the mapscii, an OpenStreetMap implementation for terminal devices, running on the above code and on Gnome-terminal.
On the left is TerminalExample, running mapscii.
On the right is gnome terminal running mapscii
Both are running on 256 colors mode + mouse tracking support. Smile

index.php?t=getfile&id=5875&private=0


As a final note: Terminal package will be availabe within this weeek.


Best regards,
Oblivion

  • Attachment: Terminal.png
    (Size: 513.88KB, Downloaded 1848 times)


[Updated on: Sat, 13 July 2019 17:39]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52075 is a reply to message #51415] Tue, 16 July 2019 09:34 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Oblivion,

Impressive work !
Re: A terminal emulator widget for U++ [message #52116 is a reply to message #51415] Sat, 20 July 2019 15:33 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

It is time to unleash the beast Smile

The initial version of Terminal package is finally released.

I suggest you read the ReadMe.md on GitHub or the "Overview" doc (qtf) inluded in the package. It'll give you a better idea of what it is.

Github address of Terminal package: https://github.com/ismail-yilmaz/upp-components/tree/master/ CtrlLib/Terminal

Examples are included in the Examples section of my git repo.

Yes, but what is it?

Excerpt form the ReadMe.md on github:

Terminal package is a flexible, easy-to-use yet powerful cross-platform virtual terminal emulation library written in C/C++ for Ultimate++.

It is designed from the ground up with modularity and maintainability in mind. 
In this respect the package consists of several re-usable classes, only one being the Terminal widget.
	
## Requirements

- Ultimate++ (ver. >= 2019.1)
- POSIX, Windows (and probably MacOS, though not tested.)
- A decent enough C/C++ compiler that supports at least C++11. (GCC/CLANG/MinGW/Msc)
- Snacks & beer.

## Features

*Note that below list is only a summary of the currently supported features. Technical specifications and documentation will be available soon. 

- Supports whatever platform Ultimate++ supports. (Linux, Windows, MacOS).
- Supports VT52/VT1xx/VT2xx, partial VT4XX/5XX, and xterm emulation modes.
- Supports user configurable device conformance levels (1, 2, 3, 4, and 0 as VT52 emulation).
- Supports both 7-bits and 8-bits I/O.
- Supports Unicode/UTF8.
- Supports user configurable, legacy "g-set" (G0/G1/G2/G3), and related shifting functions (LS0/LS1/LS1R/LS2/LS2R/LS3/LS3R).
- Supports ANSI conformance levels.
- Supports various terminal state, device, and mode reports.
- Supports DEC VT52 graphics charset, VT1xx line-drawing charset, VT2xx multinational charset, and VT3xx technical charset.
- Supports VT52/VT1xx/VT2xx keyboard emulation with function keys.
- Supports UDK (DEC's user-defined function keys feature).
- Supports user configurable blinking text and blink interval.
- Supports ANSI colors (16 colors palette).
- Supports ISO colors (256 colors palette).
- Supports xterm dynamic colors (dynamic ink/paper/selection colors).
- Supports bright colors.
- Supports background color erase (BCE).
- Supports transparency (i.e. allows background images).
- Supports VT4xx rectangular area operations: copy, invert, fill. erase.
- Supports VT4xx rectangular area checksum calculation and reporting.
- Supports both DEC and ANSI style selective erases.
- Supports alternate screen buffer.
- Supports history/scrollback buffer.
- Has a user switchable scrollbar.
- Supports xterm style alternate scroll.
- Supports resize (and optional lazy resize to reduce flicker on network terminals such as SSH-based ones).
- Supports both immediate display refresh and delayed (buffered) display refresh.
- Supports xterm style mouse tracking: button, wheel, motion, focus in/out events.
- Supports user configurable cursor styles (block, beam, underscore, blinking/steady).
- Supports cursor locking.
- Supports clipboard operations (copy/paste/select all - including history buffer) and basic drag-and-drop ops.
- Supports bracketed paste mode.
- Has a predefined yet programmable context menu (left mouse button menu).
- Supports window titles.
- Supports bell notifications.
- Supports VT1xx LEDs.
- Supports size hint.
- Supports Ultimate++ style data serialization.
- Supports per-widget customization (i.e no global variables or properties are used).
- Includes a Terminal.usc file for TheIDE's layout editor.




Reviews, bug reports, patches, suggestions are welcome.

Best regards,
Oblivion


[Updated on: Sat, 20 July 2019 15:35]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52120 is a reply to message #51415] Sun, 21 July 2019 21:15 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A Turtle example is added to the package.
You can run the Terminal example in your favorite browser and see how it works. Wink

Terminal: https://github.com/ismail-yilmaz/upp-components/tree/master/ CtrlLib/Terminal
Example: https://github.com/ismail-yilmaz/upp-components/tree/master/ Examples/TerminalInWebBrowser

Also a name clash with Turtle is fixed.

Screenshot: Lynx running on Terminal in Firefox (a.k.a "Browserception")

index.php?t=getfile&id=5877&private=0


Best regards,
Oblivion


[Updated on: Sun, 21 July 2019 21:18]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52126 is a reply to message #51415] Mon, 22 July 2019 15:56 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

More updates:

A terminal multiplexing example is added to the package.

This example demonstrates how a terminal multiplexing can be achieved simply by using a splitter widget. Splitter is a container ctrl that can be used to split any parent ctrl into resizeable horizontal and/or vertical panes. It also demonstrates the usage of NTL containers with Terminal widget:


Also a mouse capture issue is hopefully fixed.


Best regards,
Oblivon


Re: A terminal emulator widget for U++ [message #52137 is a reply to message #51415] Wed, 24 July 2019 13:24 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
A short video demonstration of Terminal ctrl (simple multiplexing example running mapscii, htop, emacs, lynx nano..):

https://vimeo.com/349761874

Best regards,
Oblivion


[Updated on: Wed, 24 July 2019 13:25]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52139 is a reply to message #52137] Fri, 26 July 2019 08:18 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Terminal based world map viewer is cool Smile

Best regards
Iñaki
Re: A terminal emulator widget for U++ [message #52143 is a reply to message #52139] Sat, 27 July 2019 11:30 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello Koldo,

Yeah it's very impressive tool. I enjoyed it.
It also helps a lot for testing.

Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #52153 is a reply to message #51415] Mon, 29 July 2019 23:23 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A small but important update.

True/direct (24-bit) color support has landed.


It is added as a compile-time option this time. (It can be easily switched using TheIDE)
The reason for this decision is that true color support increases the size of each cell by 4 bytes. (Not worriyingly high but I'm being cautious. Smile )


Latest code of terminal package can be found at: https://github.com/ismail-yilmaz/upp-components/tree/master/ CtrlLib/Terminal


Best regards,
Oblivion


[Updated on: Mon, 29 July 2019 23:26]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52179 is a reply to message #51415] Fri, 02 August 2019 13:54 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Latest round of updates:

Terminal: Clipboard and DND operations improved.
Terminal: Drag animation for drag-copy operation implemented.
Terminal: WhenClip event added. (Allows client code to inspect/accept/reject pasted/dropped clips.
Terminal: Api doc updated accordingly.


Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #52195 is a reply to message #51415] Wed, 07 August 2019 21:24 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

Terminal package is updated.
Initial support for a rare but much requested feature in the world of terminal emulators has landed:

- Sixel graphics support is added to the Terminal package. It is now possible to view sixel images, using the Terminal package.  However, the initial support is only for external viewing. Embedded images are a TODO.

- A basic terminal example with sixel viewer is also added to the package.

- SixelRenderer class and a convenience function: RenderSixelImage is also added to the package. This class and the function can also be used as a stand-alone sixel renderer.

- Alt-key handling is improved.



A screenshot:

index.php?t=getfile&id=5882&private=0

The git repo address of upp-components: https://github.com/ismail-yilmaz/upp-components


Reviews, criticism, patches, bug reports, etc., are always welcome.

Best regards,
Oblivion


[Updated on: Wed, 07 August 2019 21:44]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52227 is a reply to message #51415] Mon, 12 August 2019 11:39 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A small update on the progress of the Terminal ctrl's embedded image (sixel, etc.) support. Cool
(Note that I have yet to push changes. I'll problably push the changes next week, as there are some minor issues to solve.)

index.php?t=getfile&id=5891&private=0

This will not break the existing behavior. Sixel support will be available in both embedded and external mode.

Best regards,
Oblivion


[Updated on: Mon, 12 August 2019 11:40]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52252 is a reply to message #51415] Fri, 16 August 2019 14:29 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A day for big updates Smile

Terminal ctrl has gained embedded images and Upp::Display support.

Terminal: Embedded images support  is added (currently, sixel).
Terminal: Renderer is improved and further optimized.
Terminal: Upp::Display support for image objects are added.
Terminal: LeftAlignedImageDisplay() and RightAlingnedImageDisplay() functions added.


Screenshot:

index.php?t=getfile&id=5894&private=0


You can always find the new version here:

https://github.com/ismail-yilmaz/upp-components/tree/master/ CtrlLib/Terminal

Best regards,
Oblivion


[Updated on: Fri, 16 August 2019 14:35]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52415 is a reply to message #51415] Sun, 22 September 2019 12:01 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

Terminal package is finally updated to v0.2.

Image rendering and handling mechanism is vastly improved. Smile

- Terminal: SixelRenderer class is rewritten;
- Terminal: SixelRaster class, a StreamRaster interface for sixel images, is added to the package.
- Terminal: A subset of xterm's window-op reports are implemented.
- Terminal: An I/O synchronization issue with the PtyProcess class that led to artifacts on screen on some setups is fixed.
- Terminal: Inline image support is improved.
- Terminal: Room is made for other inline image protocols.
- Terminal: WhenSixel event is removed in favor of a generic WhenImage event.
- Terminal: Image rendering strategy is changed to cell-level rendering for further flexibility.
- Terminal: An LRU-type shared image data cache is implemented.
- Terminal: Support for Jexer, a modern text user interface (TUI) and windowing system for terminal emulators, is added.
- Terminal: A general purpose data variable is added to the cell structure.
- Terminal: SGR image flag is added to the cell structure.
- Examples: Examples are further simplified.
- Various optimizations and fixes.
- Image gallery is updated.


The "final boss" for this release was the jexer support. Jexer is a modern text user interface and window manager that runs inside terminal emulators. (It is an advanced terminal multiplexer.)

There were only four high-end terminal emulators (xterm, mlterm, rlogin and jexer itself) fully supporting the jexer, Now they are five Smile

I've made short videos of Terminal ctrl.
The ssh terminal example on windows also demonstrates the power of Core/SSH package. (It connects to a Linux device over 300 km distance, and runs jexer with inline images support, which is very demanding). Cool


On Linux
- A basic terminal example with sixel graphics, and mouse tracking support.
- Used apps and tools: Jexer text user interface (TUI), GNUPlot, Emacs, Nano, htop, ncurses demos.
- Link: https://vimeo.com/359241367

On Windows
- A basic SSH2 terminal example with sixel graphics, and mouse tracking support.
- Used apps and tools: Jexer text user interface.
- Link: https://vimeo.com/361556973

On Turtle HTML-5 backend (in a web browser)
- A basic terminal example with sixel graphics, and mouse tracking support.
- Used apps and tools: Jexer text user interface.
- Link: https://vimeo.com/361558519

Screenshot (Windows, ssh terminal example):

index.php?t=getfile&id=5912&private=0

Terminal@: https://github.com/ismail-yilmaz/upp-components/tree/master/ CtrlLib/Terminal

Best regards,
Oblivion


[Updated on: Sun, 22 September 2019 12:46]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52438 is a reply to message #51415] Sat, 28 September 2019 22:00 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A new example is added to the package: Ssh terminal splitter.

This example demonstrates the interaction between the Terminal widget and Ultimate++'s Core/SSH package, in a multithreaded environment.
Therefore it also demonstrates the usage and power of U++s own Core/SSH package in a multithreaded GUI environment.


Link to a short video showing the ssh terminal splitter in action on Windows:

https://vimeo.com/362532208

A screenshot taken from the above video:

index.php?t=getfile&id=5915&private=0


Best regards,
Oblivion





[Updated on: Sat, 28 September 2019 22:02]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52644 is a reply to message #51415] Sun, 03 November 2019 15:03 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

Terminal package and Terminal ctrl is updated.

There are fixes and clean-ups here and there, but most notably a new feature is added:

Terminal ctrl is now able to display 24-bit jpeg, gif, bmp, etc. raster formats, using the Jexer Image Protocol and Upp's own StreamRaster interface.


This means that if the raster images you are working with have registered decoders in upp/plugins, or somewhere else, Terminal ctrl will be able to display it.

Four main benefits of this inline images protocol is:

1) It is "8-bit clean". It can be safely deliver images over the network, and with Utf-8.
2) Popular image formats can be decoded much faster than sixels. (Up to 8 to 10 times faster on bigger image files), and usually have a lower bandwidth requirements.
3) Allows 24 bit (true color) images.
4) The wire protocol is very simple.


Screenshot with 24 bit images:
(Taken from the pre-alpha version of Toad, a cross-platform, multithreaded SSH2 client with tabs and splitter support, that will be available in -hopefully- January 2020):

index.php?t=getfile&id=5924&private=0


Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #52684 is a reply to message #51415] Sun, 10 November 2019 21:49 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

A new week, and another update with new features. Smile

- Explicit hyperlinks support is added.
- Standard menu  improved and modularized.
- Cell tracking methods are implemented.
- Various fixes and cosmetics.
- Docs are updated accordingly.


Explicit hyperlinks are currently supported by GCC, ls, systemd, and a number of other high profile products.
One advantage of this hyperlinks protocol is that it is relatively well-defined and cheap.

To test it on linux, compile the TerminalExample, and run an updated version of the "ls" command:

ls -l --hyperlink


Gif:

https://media.giphy.com/media/Vd32ubXONJJdnhovpE/giphy.gif


Best regards,
Oblivion



[Updated on: Sun, 10 November 2019 23:23]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #52697 is a reply to message #51415] Tue, 12 November 2019 16:36 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

I have pushed another update, which contains features that were brewing for a while:

- Terminal: Rectangle selection is now supported.
- Terminal: Iniline images can now be copied to clipboard or sent to client. (It uses the same mechanism as hyperlinks: CTRL + double click or context menu)
- Terminal: Options menu is implemented. Options menu contains the most relevant options for terminal. 


Screenshot:

index.php?t=getfile&id=5933&private=0


Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #52700 is a reply to message #51415] Tue, 12 November 2019 20:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
As a last minute bonus:

DnD operations and animations are added for both hyperlinks and inline images. (Activated with CTRL-key modifier)


Smile

Gif:

https://media.giphy.com/media/XZ0ohRJVbacfg0KFcc/giphy.gif



Enjoy!

Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #53262 is a reply to message #51415] Wed, 25 March 2020 14:20 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

Three months of silence is finally broken. Smile

Terminal package is scheduled to be updated to v0.3 on April 6, 2020.

Meanwhile the package has seen tons of improvements. (Note that the changes are not pushed to git yet).

Some highlights of the upcoming version:

- Initial steps for scripting support (using the Esc language).
- A proper double-width (Eastern-Asian/CJK) characters support.
- A proper tmux/screen support.
- A proper support for ISO 8613-6 true/indexed color formats.
- A much faster renderer. (In some torture tests (such as ncurses/dots on fulscreen mode) the performance gain can be up to %80.


And much more... (full list will be available with the release).

I am currently testing the package for regressions.


To whet yout appetite (tmux/screen, on Linux):

index.php?t=getfile&id=6022&private=0

Best regards,
Oblivion




[Updated on: Wed, 25 March 2020 14:34]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #53277 is a reply to message #53262] Wed, 25 March 2020 19:12 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 281
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Oblivion

For double-width font support are you using Harfbuzz? Will it support Indic scripts?

Quote:
- A proper double-width (Eastern-Asian/CJK) characters support.


Warm Regards

Deepak
Re: A terminal emulator widget for U++ [message #53290 is a reply to message #53277] Thu, 26 March 2020 16:54 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello Deepak,


Quote:
Will it support Indic scripts?


This is my intention, with other scripts (Arabic, etc.) and Bi-directional rendering.

But unfortunately it will not happen in the upcoming v0.3 release.
At the moment what I can provide is double witdth support for CJK ideographs and other double width Asian characters.

As for the harfbuzz, currently I am using what U++ uses on GTK and/or X11.
And AFAIK, GTK 3.x uses harfbuzz by default.


Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #53542 is a reply to message #51415] Fri, 10 April 2020 02:17 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

The day has come. Terminal package is upgraded to v0.3. Smile

This is a huge release, with lots of changes, fixes, additions and improvements.

I am not going to list every change but some highlights here. If you want to see the full list, please check out the git history.

- Source code is restructured.
- Console class is ditched for the sake of simplicity. There is now only Terminal, deriving from Upp:CTrl.
- Eastern-Asian/CJK double width characters support is added.
- Text overline attribute is now supported.
- APCs (application programming commands) are now supported. This is the first step towards terminal scripting feature. APCs can be also be used by client code for private purposes.
- TRUECOLOR flag is removed. Terminal ctrl is now fully and officially a true color terminal emulator.
- Accordingly, CMY and CMYK color spaces are now supported too!
- Support for color text specifications (rgb, hash3, hash6, hash9, hash12) are added.
- xterm window actions are reports are implemented. It is now possible for host apps to move, resize, minimize, maximize, fullscreen the terminal.
- Renderer has seen a significat performance boost (up to 80% on some torture tests).
- tmux/screen is fully supported.
- Hyperlinks now show nice dots under their texts when they are "inactive" (i.e. no mouse hovering over them)
- API docs and specifications docs are significantly improved.



But how compliant is it?

Using George Nachmann's (iTerm2's developer) excellent and comprehensive test suite (it is analogous to the browser standard compliance tests), esctest, the results are as follows:


expected-terminal=xterm
max-vt-level=4

Terminal ctrl: v0.3, passed 407 tests, failed on 101 tests, 

Terminal ctrl: v0.2 passed only 160 of the same tests.


Let us now look at the latest stable version of Gnome terminal and Kitty, with same settings:

expected-terminal=xterm
max-vt-level=4

Gnome Terminal (v.3.36.1.1): passed 163 tests and failed on 345 tests.

Kitty: passed 122 tests, and failed on 386 tests.

xterm: Fassed all tests. (not suprisingly) 


Keep in mind that I am not even implying that Terminal ctrl is better. (It isn't. Gnome Terminal is a very high quality product with excellent features).

I am simply pointing out where our VT engine stands on the xterm compliance front (since xterm is the defacto standard), and the progress made with the nev version.


Hyperlinks with dots:

index.php?t=getfile&id=6040&private=0

You can find the new version on my git repo.

If you have any questions, suggestions, bug reports, patches, feature requests, etc. please feel free to contact me via my github address or this forum topic.

Enjoy!


Best regards,
Oblivion



[Updated on: Fri, 10 April 2020 11:40]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #53551 is a reply to message #51415] Sat, 11 April 2020 00:30 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
A last minute bonus:

Terminal ctrl now supports the popular iTerm2's inline image protocol too. Smile
(See api and specification docs for more details)

Best regards,
Oblivion


Re: A terminal emulator widget for U++ [message #53639 is a reply to message #51415] Fri, 17 April 2020 22:30 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

Terminal ctrl has received a small but important update:

Autowrap mode is fixed.


The mode setting somehow got lost in the v0.2 -> v0.3 transition. Embarassed

I recommend you to update the package as the autowrap feature is widely used by command line applications.

Best regards,
Oblivion


[Updated on: Fri, 17 April 2020 22:31]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #53690 is a reply to message #51415] Tue, 21 April 2020 18:35 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hello,

Terminal has gained two small features.

- Jsonization support is added.
- Xmlization support is added.


It is now possible to store/load the configuration (including color table) of Terminal ctrl instances in/from xml and json files, in a human readable form.

Also, missing tester methods (i.e, Isxxx()/Hasxxx()) are added and docs are updated accordingly.

Best regards,
Oblivion.


[Updated on: Tue, 21 April 2020 18:37]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #53704 is a reply to message #51415] Wed, 22 April 2020 18:51 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
A small but important news is that I've found a bottleneck in the Terminal ctrl's code that was puzzling me for some time.
It was in the display update and scrolling mechanism. Hopefully I have fixed it. Smile

However, I won't push the change to github before I test it thoroughly and be sure it doesn't break anything.

It appears that, after the fix, Terminal ctrl will be one of the most fastest out there.

Below statistics are the average results of a test automatically run 100 times:

All terminal emulators use the same font/page size settings, and run on Gnome 3.36


Results of command: time find /usr/share

Terminal Emulator                  real         user        sys
-----------------                 ----------   ----------   ----------
Terminal Ctrl (Current):          0m23,104s    0m1,297s     0m2,879s
Terminal Ctrl (with fix):       **0m4,002s     0m0,774s     0m1,622s**
xterm                             0m15,059s    0m0,991s     0m2,527s
Gnome Terminal                    0m4,217s     0m0,778s     0m1,773s
Kitty                             0m4,907s     0m0,887s     0m2,325s


If everything goes well, I will push this change next week.

Best regards,
Oblivion


[Updated on: Wed, 22 April 2020 18:55]

Report message to a moderator

Previous Topic: SerialPort & SerialPortListener class
Next Topic: Added NetCDF library
Goto Forum:
  


Current Time: Thu Apr 30 17:18:21 GMT+2 2026

Total time taken to generate the page: 0.01212 seconds