-
Notifications
You must be signed in to change notification settings - Fork 15
Replacing swipl‐win
Jan Wielemaker edited this page Jul 18, 2025
·
8 revisions
swipl-win has two implementations: one using the Win32 GDI and one using Qt for MacOS and Linux. The Win32 version is getting outdated and the Qt version is a heavy dependency. This sub-project will replace both by an XPCE on SDL+Cairo based embedded terminal.
This project adds a class terminal_image, similar to text_image that provides the basic terminal emulation as an XPCE subclass of graphical. Outline
- Use the Windows
swipl-wincode that implements a two-dimensional terminal with savelines and ANSI escape code handling.- Wrap the code into class
terminal_image, using XPCE's core infrastructure. - Allow a Prolog thread to act as "client"
- On non-Windows system, use a PTY for the interface. This way we can reuse the
editlinecommand line editor. Alsoshell/0,1and friends work out-of-the-box.
- On non-Windows system, use a PTY for the interface. This way we can reuse the
- Wrap the code into class
- Implement
terminal_image- Basic terminal rendering
- Map events to terminal actions
- Implement client interaction using POSIX pseudo terminal (PTY)
- How to deal with Windows?
- Implement ANSI terminal handling
- Basic sequences
- Bold and underline
- The 16 ANSI colors
- 256 color scheme
- Direct color
- Implement a Prolog library to create a fully functional terminal
- Wrap into class
epilog- Add scrolling
- Connect to a Prolog thread
- Add menu
- Allow multiple terminals (split horizontal/vertical)
- Proper history handling
- Deal with thread-local Prolog flags.
- Wrap into class
- Allow using Epilog as main console, such that we can use this as "App"/GUI application
- Provide
swipl-winsubstitude usingswipl -Depilog - Add new executable (
swipl-win) that starts Epilog - Run initialization commands in the Epilog environment.
- Provide
- Do we need/want shell job control?
-
cls/0often leads to assertion error - Handle
\e[<n>@to insert<n>spaces at the current location. Needed for libedit insert. -
lessquit does not properly clean screen- Support mouse events
-
shell(top)does not work properly yet. - Trackpad scrolling seems broken.
- Double-width characters such as emoji are not handled property.