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++ » UppHub » A terminal emulator widget for U++
Re: A terminal emulator widget for U++ [message #56243 is a reply to message #56242] Fri, 12 February 2021 23:14 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hello Klugier,

Thanks for the info.

That's what I've suspected, and that's why I asked for you the check it against xterm.

The bash config. sets the ink color to white. (SGR 37). That color is meant to be changed by the user, If the background (which can be overridden by the theme) is the same color, then it'll be unreadble. (unless you explicitly set the color white or the paper color to something else on TerminalCtrl.)


I reproduced it with xterm, GNOME terminal, VTE and kitty. Smile
We can call it a bash config/theme clash and a false alarm.

Best regards,

Oblivion


[Updated on: Fri, 12 February 2021 23:18]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #56348 is a reply to message #51415] Tue, 23 February 2021 22:57 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
A small tip:

TerminalCtrl can display PowerLine fonts and glyphs
By default, however, if you install and try to use PowerLine fonts, you will notice that some glyphs are missing. This is because U++ handles its fallback fonts through a compile-time list.
In order to utilize powerline fonts, all you need to do is add the following line to the end of fallback fonts lists [sFontReplacements array], in Draw/FontCR.cpp:

{ "PowerlineSymbols", 0x00000000, 0x08000008 },


This method can be applied to other fonts as well. Just use uppbox/FontCover app to calculate the font range for your desired font.

If you recompile U++, set up powerline fonts support and configure apps, say vim, you should get a display similar to the below screenshot(taken via stock TerminalLayoutExample):

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


Best regards,
Oblivion


[Updated on: Tue, 23 February 2021 23:13]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #56368 is a reply to message #51415] Sat, 27 February 2021 22:07 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hello,

tldlr:

In the following weeks TerminalCtrl will finally gain winpty support.
This means that it will be able to run as a local terminal ("natively") on Windows XP/Vista/7/8/10, without requiring Cygwin, Msys2 or Win10 pseudoconsole api. Smile

This idea was brewing for some time as I was investigating the possibility of embedding native windows console support in PtyProcess class.

As it turned out, it was suprisingly trivial, thanks to winpty.

Pros:

1. TerminalCtrl does not require any specific hack or intervention to run on Windows as a local (=not remote) console, thanks to its design and WinPty.

2. Cygwin or MSYS2 are not required. Only the libwinpty (winpty.lib or winpty.dll) and winpty-agent is required and they compile on native CLANG compiler and Windows environment.

3. WinPty's API seamlessly integrates with PtyProcess class and it api. As a result, the existing terminal examples or code using PtyProcess class do not require any modification. A simple compiler flag (flagWINPTY) will be enough to switch it on.

4. This means it is possible run cmd.exe, bash.exe, powershell.exe, or any Windows-native console application (such as FAR file manager - see screenshot below) directly on TerminalCtrl/PtyProcess.

5. This also means that TerminalCtrl can be set to run in CygWin and Msys2 environments, and it can easily replace Mintty, which is, AFAIK, bound to Cygwin or Msys2 subsystem.

6. winpty has MIT license. You can freely supply the winpty.lib and winpty-agent with your application.


Cons:

- Nothing much at the moment, really. Winpty has some small quirks but they arent specific to our terminal emulator widget.


Below screenshot is from the Far file manager. It is running natively on the stock TerminalExample, on Windows 7.

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


If you have any questions, bug reports, suggestions criticism, etc. let me know.


Best regards,
Oblivion



[Updated on: Sat, 27 February 2021 22:23]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #56383 is a reply to message #51415] Mon, 01 March 2021 23:49 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hi,

TerminalCtrl now officially supports winpty on Windows platform.

This effectively eliminates one of the major "show-stoppers" we've had up until now with TerminalCtrl: Native console support on Windows XP/Vista/7/8. (ıt can also be used on Win10, but we already have PTY support for that version of windows)

You have two choice here should you select the WINPTY backend:

1) You can compile winpty-agent, winpty.dll and winpty.lib. These files can be easily created, It is not a complicated process.
2) You can use the existing files in your system (for example you can get them from MSYS2 installation or from the GIT Windows client). Just put the agent and dll in the same directory as your terminal app and link your app against winpty.lib (by activating WINPTY flag).

 


In the process, I made a so-called "course-correction" which unfortunately slightly breaks the existing TerminalCtrl installations: I have removed the PtyProcess code from TerminalCtrl source tree and made it into a separate pacakge.
Thus you will need to explicitly add PtyProcess package and its heeader file to your apllications if you want to use it.

E.g.
#include <PtyProcess/PtyProcess.h>


I apologize for this break, but hopefully this will allow easier maintenance and better separation of code.


Best regards,
Oblivion


[Updated on: Mon, 01 March 2021 23:54]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #56393 is a reply to message #51415] Wed, 03 March 2021 20:45 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hi a small update,

I have already managed to compile and statically link winpty library with stock Upp and the bundled clang compiler with very little wrestling.
Not to mention that winpty has MIT license.. This means we can simply provide the library with the PtyProcess package, and preferably making it the default backend, for easy maintenance and development. This and testing shouldn't take more than a week or so.
Later I can wrestle with MSC. Smile


Best regards,
Oblivion




[Updated on: Wed, 03 March 2021 20:45]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #56404 is a reply to message #51415] Sun, 07 March 2021 14:42 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hello,


- PtyProcess package now contains a patched and statically linked version of libwinpty.

- winpty is from now on the default pty backend on Windows platform. No WINPTY flag is required to activate it.

- Since winpty requires an agent executable, I have also added PtyAgent to both TerminalCtrl nest on UppHub and to upp-components/Core.

- After building the PtyAgent, just move the resulting exacutable (PtyAgent.exe) to your apps executables directory.

- Package is tested with CLANG. MSC will follow...


This means that effectively Terminal package -as a local pty- and its examples are now able to run and work on various versions of Windows.



If you have any questions or suggestions, let me know.

Best regards,
Oblivion



[Updated on: Sun, 07 March 2021 14:44]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #56929 is a reply to message #51415] Sat, 01 May 2021 14:17 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hi,

Terminal package is updated. This update is somewhat big, as the 2021.1 release is imminent.
Consider the below changes as a summary of 2021.1 milestone (v0.5) changes/highlights:

Changes:

* Cell padding (horizontal/vertical) is implemented.
* Missing tester methods are implemented.
+ Display renderer is refactored and optimized.
+ Parser (VTInstream) is optimized, using chunking in addition to traditional state machine. It is ~82% faster on average.on a reference machine.
+ Sixel renderer is refactored and optimized. The renderer's raw performance is almost doubled. From 14 to 27 MB/s on a reference machine. 
+ An out-of-bounds crash with dynamic colors feature is fixed.
+ Dynamic colors feature is improved. It can now set/reset multiple colors in a single command.
+ Display refreshing strategy is improved.
+ Local echo now correctly calls the display refreshing methods.
+ A crash when selecting wrapped text lines is fixed.
+ Parser now allows OSC sequences to have UTF-8 payload on  UTF-8 parsing mode.
+ SGR mouse tracking mode gained a pixel-level tracking variant. 
+ UTf-8 titles (xterm extension) are now correctly displayed and reported.
+ On Windows Vista, 7, 8, 10 PtyProcess now allows native console applications via WinPty.
+ On windows, PtyProcess now defaults to statically linked WinPty backend. (Win10 api stays as the recommended option on Windows ver. >= 10)
+ On windows native console (Via WinPty), TerminalCtrl now correctly refreshes the page size after a window size change.
+ Deprecated "Terminal" alias is now removed. 



Only a few more compliance tests and cosmetic changes remain. After that, I'll mark this as 2021.1


Suggestions, bug reports, etc .are welcome.

Best regards,
Oblivion


[Updated on: Sat, 01 May 2021 14:58]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #57100 is a reply to message #51415] Tue, 25 May 2021 13:00 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hi,

TerminalCtrl will be marked as v0.5 (2021.1) next week. This release will have a lot of improvements.

TerminalLayoutExample (the GUI building example) will include some more tricks such as unicode input method (demonstrating the way to use popup windows with TerminalCtrl.)

A preview (gif):

https://i.imgur.com/e5h3vjz.gif


Smile

This will be available next week.

Best regards,

Oblivion


[Updated on: Fri, 28 May 2021 11:36]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #57126 is a reply to message #51415] Thu, 27 May 2021 20:39 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
I usually don't add screenshots or gifs from Windows, but here it is:

TerminalLayoutExample, running on Windows 7 (Winpty/cmd.exe), demonstrating the improved unicode codepoint insertion popup and a simple banner, using echo parser. (will be available next week)

https://i.imgur.com/JjUa46b.gif


Best regards,
Oblivion


[Updated on: Thu, 27 May 2021 21:15]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #57136 is a reply to message #51415] Sat, 29 May 2021 18:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced Contributor
Hello,

Terminal package is tagged as 2021.1 and officially released/updated. It is available via Upphub and upp-components repo.
This version brings many improvements (such as Windows 7/8/10, winpty support) and bug fixes. See my previous posts and git logs. for details.


Best regards,
Oblivion


[Updated on: Sat, 29 May 2021 19:59]

Report message to a moderator

Re: A terminal emulator widget for U++ [message #57242 is a reply to message #57136] Tue, 15 June 2021 16:41 Go to previous message
Novo is currently offline  Novo
Messages: 1267
Registered: December 2006
Senior Contributor
Compilation problem on Mac while compiling TerminalInWebBrowserExample:
/Users/ssg/worker0/m-upphub-TerminalCtrl/build/TerminalCtrl/Terminal/Keys.cpp:312:89: error: use of undeclared identifier 'K_OPTION_KEY'; did you mean 'K_OPTION'?
        if(findarg(key & ~(K_CTRL|K_ALT|K_SHIFT|K_OPTION), K_CTRL_KEY, K_ALT_KEY, K_SHIFT_KEY, K_OPTION_KEY) >= 0)
                                                                                               ^~~~~~~~~~~~
                                                                                               K_OPTION
/Users/ssg/dvlp/cpp/code/upp/git/uppsrc/CtrlCore/CtrlCore.h:103:2: note: 'K_OPTION' declared here
        K_OPTION       = 0x4000000,
        ^

MacOS can be easily installed in a VM (check for such projects on github).


Regards,
Novo
Previous Topic: Turtle & Mac
Next Topic: SysExec
Goto Forum:
  


Current Time: Thu Oct 21 06:28:08 CEST 2021

Total time taken to generate the page: 0.01366 seconds