Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bench-native-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
BUN_VERSION: 1.3.14
ZIG_VERSION: 0.15.2
ZIG_VERSION: 0.16.0

jobs:
bench-native-smoke:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
NODE_VERSION: 26.4.0
ZIG_VERSION: 0.15.2
ZIG_VERSION: 0.16.0

jobs:
build:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-keymap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
if: runner.os != 'Windows'
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down Expand Up @@ -91,15 +91,15 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
ZIG_VERSION: 0.15.2
ZIG_VERSION: 0.16.0

jobs:
build-native:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/build-qrcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ concurrency:

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Workaround for bug in Zig 0.15.2 (fixed in next version)
# https://github.com/ziglang/zig/issues/25805
ZIG_GLOBAL_CACHE_DIR: ${{ github.workspace }}/.zig-global-cache

jobs:
test:
Expand All @@ -41,16 +38,15 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
use-cache: false
version: 0.16.0

- name: Restore Zig cache
if: runner.os != 'Windows'
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
if: runner.os != 'Windows'
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/build-solid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
if: runner.os != 'Windows'
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down Expand Up @@ -88,15 +88,15 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down Expand Up @@ -136,15 +136,15 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
# Keep Zig's cache path on the workspace drive, but do not restore/save
# stale .zig-cache archives on Windows; Zig 0.15.2 can fail with missing cache files.
# stale .zig-cache archives on Windows can contain missing cache files.
use-cache: ${{ runner.os != 'Windows' }}
cache-key: build-ssh

Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
cache-key: build-ssh-packed

- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Generate snapshot version
id: version_scheme
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
version: 0.16.0
use-cache: false

- name: Restore Zig cache
uses: actions/cache@v5
with:
path: .zig-cache
key: zig-v1-${{ runner.os }}-0.15.2-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.15.2-
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-

- name: Install dependencies
run: bun install
Expand Down
2 changes: 1 addition & 1 deletion .zig-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.15.2
0.16.0
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"publish": "bun scripts/publish.ts",
"test:dist": "bun scripts/dist-test.ts",
"test:standalone": "bun scripts/standalone-test.ts",
"test:js": "bun test",
"test:js": "bun test --path-ignore-patterns='src/zig/zig-pkg/**'",
"test:js:node": "bun scripts/test-node.ts",
"test": "bun run test:native && bun run test:js"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,10 @@ class ScrollbackSnapshotRenderContext extends EventEmitter implements RenderCont
}

const DEFAULT_FORWARDED_ENV_KEYS = [
"SSH_CONNECTION",
"SSH_CLIENT",
"SSH_TTY",
"MOSH_CONNECTION",
"TMUX",
"ZELLIJ",
"ZELLIJ_SESSION_NAME",
Expand Down Expand Up @@ -1138,7 +1142,7 @@ export class CliRenderer extends EventEmitter implements RenderContext {
this.clearOnShutdown = config.clearOnShutdown ?? true
this.lib.setClearOnShutdown(this.rendererPtr, this.clearOnShutdown)

const forwardEnvKeys = config.forwardEnvKeys ?? (config.remote === false ? [...DEFAULT_FORWARDED_ENV_KEYS] : [])
const forwardEnvKeys = config.forwardEnvKeys ?? (remoteMode === true ? [] : [...DEFAULT_FORWARDED_ENV_KEYS])
for (const key of forwardEnvKeys) {
const value = process.env[key]
if (value === undefined) continue
Expand Down
19 changes: 18 additions & 1 deletion packages/core/src/tests/renderer.remote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, expect, test } from "bun:test"
type RendererFactory = "test" | "direct-process-memory" | "cli-custom-memory" | "cli-custom-feed"

async function getCapabilitiesFromChild(
options: { remote?: boolean },
options: { remote?: boolean; forwardEnvKeys?: string[] },
env: Record<string, string>,
factory: RendererFactory = "test",
): Promise<any> {
Expand Down Expand Up @@ -160,6 +160,23 @@ describe("remote detection", () => {
expect(caps.terminal.name).toBe("")
})

test("explicit remote mode applies explicitly forwarded terminal overrides", async () => {
const caps = await getCapabilitiesFromChild(
{ remote: true, forwardEnvKeys: ["TERM", "OPENTUI_FORCE_WCWIDTH"] },
{
PATH: process.env.PATH ?? "",
HOME: process.env.HOME ?? "",
TMPDIR: process.env.TMPDIR ?? "/tmp",
TERM: "xterm-256color",
OPENTUI_FORCE_WCWIDTH: "1",
},
)

expect(caps.remote).toBe(true)
expect(caps.ansi256).toBe(true)
expect(caps.unicode).toBe("wcwidth")
})

test("process stdout with memory output preserves auto remote detection", async () => {
const caps = await getCapabilitiesFromChild(
{},
Expand Down
Loading
Loading