[Init] Initial commit - NetMesh terminal manager
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
This commit is contained in:
47
electron/plugins/terminalInterceptorMessages.test.cjs
Normal file
47
electron/plugins/terminalInterceptorMessages.test.cjs
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
const assert = require("node:assert/strict");
|
||||
const test = require("node:test");
|
||||
|
||||
const {
|
||||
terminalInterceptorChoiceLabel,
|
||||
terminalInterceptorIdentifier,
|
||||
terminalInterceptorMessages,
|
||||
} = require("./terminalInterceptorMessages.cjs");
|
||||
|
||||
test("terminal interceptor native prompts cover every application locale and fall back to English", () => {
|
||||
for (const locale of ["en", "zh-CN", "zh-TW", "ru"]) {
|
||||
const messages = terminalInterceptorMessages(locale);
|
||||
assert.ok(messages.noInterceptor);
|
||||
assert.ok(messages.selectTitle("input"));
|
||||
assert.ok(messages.selectMessage("output"));
|
||||
assert.ok(messages.warningTitle);
|
||||
}
|
||||
assert.equal(terminalInterceptorMessages("fr").noInterceptor, "No interceptor");
|
||||
});
|
||||
|
||||
test("plugin-controlled native selection labels visibly escape control and bidi text", () => {
|
||||
assert.equal(terminalInterceptorChoiceLabel({
|
||||
pluginId: "com.example.safe",
|
||||
pluginDisplayName: "safe\nname\u202e",
|
||||
provider: { id: "com.example.input", label: "input\tfilter" },
|
||||
}), "safe\\nname\\u202e (com.example.safe): input\\tfilter (com.example.input)");
|
||||
assert.equal(terminalInterceptorIdentifier("provider\r\u2066"), "provider\\r\\u2066");
|
||||
});
|
||||
|
||||
test("selection labels keep distinct valid provider identifiers visible in full", () => {
|
||||
const shared = `com.example.${"a".repeat(170)}`;
|
||||
const first = terminalInterceptorChoiceLabel({
|
||||
pluginId: "com.example",
|
||||
pluginDisplayName: "Plugin",
|
||||
provider: { id: `${shared}.first`, label: "Filter" },
|
||||
});
|
||||
const second = terminalInterceptorChoiceLabel({
|
||||
pluginId: "com.example",
|
||||
pluginDisplayName: "Plugin",
|
||||
provider: { id: `${shared}.other`, label: "Filter" },
|
||||
});
|
||||
assert.notEqual(first, second);
|
||||
assert.match(first, /\.first\)$/u);
|
||||
assert.match(second, /\.other\)$/u);
|
||||
});
|
||||
Reference in New Issue
Block a user