Skip to content

Add a new VT-100 compatible built-in terminal emulator#3903

Merged
eranif merged 16 commits intomasterfrom
terminal-view
Mar 31, 2026
Merged

Add a new VT-100 compatible built-in terminal emulator#3903
eranif merged 16 commits intomasterfrom
terminal-view

Conversation

@eranif
Copy link
Copy Markdown
Owner

@eranif eranif commented Mar 31, 2026

Summary

This PR introduces a new VT-100 compatible built-in terminal emulator and integrates it into CodeLite. It improves terminal input handling, process execution, shutdown behavior, shortcut support, and event plumbing, while also adding terminal theme import support and a bundled theme pack.

Key Changes

  • Add a new VT-100 compatible terminal emulator
  • Improve terminal input handling and process execution
  • Add terminal accelerator handling for common shell shortcuts
  • Fix shutdown handling
  • Add optional environment support in the built-in terminal pane
  • Add terminal theme import support and a large theme pack
  • Update terminal event types and app event filtering hooks
  • Apply platform-specific build fixes and related submodule updates

Notes

  • Includes fixes for non-Windows and non-macOS builds
  • Updates terminal-related submodules and workspace configuration

eranif added 16 commits March 30, 2026 01:46
Signed-off-by: Eran Ifrah <eran@codelite.org>
Remove unnecessary manipulation of parent process standard handles during child process creation. The previous implementation saved and modified the parent's stdin/stdout/stderr handles, which was error-prone and unnecessary since child process handles can be specified directly via STARTUPINFO.

The key changes include:
* Removed save/restore operations for parent process standard handles (hSaveStdin, hSaveStdout, hSaveStderr)
* Removed SetStdHandle calls that modified the parent process
* Fixed console creation flag logic to use CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE when redirecting output, as Windows ignores STARTF_USESTDHANDLES with CREATE_NEW_CONSOLE
* Removed console attachment and freopen logic that is no longer needed

This simplifies the code and fixes a bug where output redirection could fail when creating hidden console processes.

* AsyncProcess/winprocess_impl.h: Remove unused handle declarations
* AsyncProcess/winprocess_impl.cpp: Simplify I/O redirection logic and fix console flags

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Refresh the built-in terminal pane to use the newer wxTerminalEmulator submodule APIs and the renamed terminal event class. The pane now builds against the updated terminal view/control types, uses the modern toolbar implementation, and creates terminal tabs directly from the selected shell command while keeping tab titles and lifecycle events in sync.

The terminal launcher also simplifies its UX by always showing the built-in terminal panel instead of toggling focus state manually.

* Terminal pane
* wxTerminalCtrl events
* Debugger process startup

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Update the application and event-notifier plumbing to support event-type
filter registration and filtering at the wxApp level. This introduces a
callback-based filter registry in EventNotifier, exposes a new FilterEvent
override on CodeLiteApp, and wires the app through to the notifier so future
event interception can be centralized.

The app class declaration was also reorganized to place members and method
declarations under clearer access sections, and the bundled wxTerminalEmulator
submodule was advanced to a newer commit.

* Core event handling
* App lifecycle and class layout
* Submodule update

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Update the built-in terminal creation path to pass an explicit optional
environment list, keeping the default behavior of inheriting the parent
process environment while aligning the terminal constructor call with the
updated submodule API.

Also apply style and formatting cleanup in the environment variables dialog
to keep the codebase consistent.

* Builtin terminal
* Environment variables dialog

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Improve the built-in terminal experience by routing key events through the active terminal control when it has focus, so input handling works more reliably for embedded terminals. The default Windows terminal choice is also updated to PowerShell, reflecting the preferred shell on that platform.

This change additionally modernizes Windows process execution in the safe command runner by delegating process launch and output collection to the assistant process helper, while preserving shutdown-aware output handling. At the application level, startup now detaches from the console when possible, and the global event filter is extended so registered callbacks can consume events instead of only observing them.

* Terminal
* Process Execution
* Event Filtering

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Signed-off-by: Eran Ifrah <eran@codelite.org>
Normalize the Linux workspace file formatting to a consistent, expanded JSON style while preserving the existing build, clean, install, and packaging targets for the supported Debug, Release, and GTK2 configurations.

Also bump the wxTerminalEmulator submodule to a newer revision.

* workspace
* submodules

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Signed-off-by: Eran Ifrah <eran@codelite.org>
Replace the previous global key event filtering with explicit accelerator bindings on the active terminal control. This keeps shortcut handling scoped to the focused terminal and routes common shell commands such as clear line, clear screen, interrupt, word navigation, and cursor movement through dedicated handlers.

The implementation also updates the embedded wxTerminalEmulator submodule to pick up the new terminal-side shortcut support used by these actions.

* Terminal shortcuts
* Submodule update

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Tighten process execution shutdown handling by treating a missing
shutdown flag as a non-cancelled run instead of dereferencing it, which avoids
an unnecessary early exit path.

* Terminal pane
* Process utilities

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Signed-off-by: Eran Ifrah <eran@codelite.org>
Fixed a call to `AddObject` with an empty string which does not make sense as it will return `JSONItem{nullptr}`.

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Refresh the macOS workspace definition to use consistent JSON formatting and preserve the existing build, clean, and file filtering settings. Also advance the wxTerminalEmulator submodule to the newer upstream revision.

* Workspace
* Submodule

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Add support for loading terminal color themes from bundled TOML files and
apply the selected theme to new and existing terminal tabs. The builtin
terminal pane now discovers theme definitions at startup, lets users choose a
theme from the toolbar, persists the selection, and reapplies colors when the
application or system theme changes.

This also expands the terminal theme catalog substantially by shipping a large
set of Alacritty-compatible palette files, and updates the wxTerminalEmulator
submodule to a newer revision that supports the new theme handling.

* terminal pane
* bundled theme assets
* wxTerminalEmulator submodule

**Generated by CodeLite**

Signed-off-by: Eran Ifrah <eran@codelite.org>
Signed-off-by: Eran Ifrah <eran@codelite.org>
Comment on lines +113 to +114
target_include_directories(plugin
PUBLIC ${CL_SRC_ROOT}/submodules/wxTerminalEmulator)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target wxterminal_lib might add it in its INTERFACE, so target_link_libraries is sufficient.

@Jarod42
Copy link
Copy Markdown
Collaborator

Jarod42 commented Mar 31, 2026

I don't know how are your settings for notification about your sub projects, but I added some issues for wxTerminalEmulator.
(And Have old PR for assistant ;-) )

clDEBUG() << "Writing remote workspaces to disk" << endl;
JSONItem arr = JSONItem::createArray();
for (const auto& wi : curitems) {
auto d = arr.AddObject(wxEmptyString);
Copy link
Copy Markdown
Owner Author

@eranif eranif Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jarod42 FYI: the old code used this and it worked. With the new JSON code, it will return a JSONItem{nullptr}.
The old code assumed that when "AddObject" called on an "array" -> will create a new indexed object and return it. With the latest changes, the logic is:

  • Create new object
  • Add it with a name
  • Find and return it

Since name in this case is empty, it returns a null object.

The impact was that it erased my "Recently opened Remote Workspaces" configuration entries.

@eranif eranif merged commit a9936b1 into master Mar 31, 2026
16 checks passed
@eranif eranif deleted the terminal-view branch March 31, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants