Skip to content

Make HeadlessTerminal.process public#460

Merged
migueldeicaza merged 1 commit intomigueldeicaza:mainfrom
zxss702:main
Feb 3, 2026
Merged

Make HeadlessTerminal.process public#460
migueldeicaza merged 1 commit intomigueldeicaza:mainfrom
zxss702:main

Conversation

@zxss702
Copy link
Contributor

@zxss702 zxss702 commented Feb 3, 2026

The process property in HeadlessTerminal was internal, making it inaccessible from external modules that import SwiftTerm. This prevented users from calling startProcess() on the LocalProcess instance.

Since HeadlessTerminal is designed to provide a headless terminal emulator that can be scripted and screen-scraped, users need access to the underlying LocalProcess to start a child process after initialization.

This change aligns with the existing pattern in the package's own CaptureOutput target, which also accesses the process property directly (but works because it's in the same package).

The following members were internal, making them inaccessible from
external modules that import SwiftTerm:

1. process: LocalProcess - Users need this to call startProcess() after
   initialization to start a child process.

2. send(data: ArraySlice<UInt8>) and send(_ text: String) - Users need
   these to send commands to the terminal. Previously, the only public
   send method was send(source: Terminal, data: ArraySlice<UInt8>),
   which is a protocol method with unnecessary parameters.

This change aligns with the existing pattern in the package's own
CaptureOutput target, which also accesses these members directly.
@migueldeicaza migueldeicaza merged commit 032ead5 into migueldeicaza:main Feb 3, 2026
@migueldeicaza
Copy link
Owner

Thanks!

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

Comments