Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bazaar » 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: 561
Registered: August 2007
Location: Turkey
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: 2959
Registered: August 2008
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: 561
Registered: August 2007
Location: Turkey
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: 561
Registered: August 2007
Location: Turkey
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: 2959
Registered: August 2008
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: 817
Registered: December 2006
Experienced 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: 561
Registered: August 2007
Location: Turkey
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: 817
Registered: December 2006
Experienced 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: 561
Registered: August 2007
Location: Turkey
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: 561
Registered: August 2007
Location: Turkey
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: 60
Registered: August 2018
Location: France
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: 561
Registered: August 2007
Location: Turkey
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 message
Oblivion is currently offline  Oblivion
Messages: 561
Registered: August 2007
Location: Turkey
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

Previous Topic: MATLAB .mat files handling
Next Topic: WithEnterAction compile error
Goto Forum:
  


Current Time: Thu Jun 20 06:56:00 CEST 2019

Total time taken to generate the page: 0.00914 seconds