Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
82956f5 to
2dc9d57
Compare
There was a problem hiding this comment.
Devin Review found 9 potential issues.
2 security issues not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
There was a problem hiding this comment.
| prompt.question(question, (answer) => { | ||
| prompt.close(); | ||
| resolve(answer.trim()); | ||
| }); | ||
| prompt.on("close", () => resolve("")); |
There was a problem hiding this comment.
🔴 Discarded SSH setup destination
When users enter a destination, ask closes readline before returning their answer. The synchronous close handler resolves with an empty string, so setup exits without connecting.
| prompt.question(question, (answer) => { | |
| prompt.close(); | |
| resolve(answer.trim()); | |
| }); | |
| prompt.on("close", () => resolve("")); | |
| prompt.question(question, (answer) => { | |
| resolve(answer.trim()); | |
| prompt.close(); | |
| }); | |
| prompt.on("close", () => resolve("")); |
Was this helpful? React with 👍 or 👎 to provide feedback.
| private async openHere(url: string): Promise<number> { | ||
| const local = this.options.proxy ? null : await renderLocally(url); | ||
| if (typeof local === "number") return local; | ||
| const window = attachWindow(local ?? url, this.options); | ||
| this.closeWindow = () => window.close(); |
There was a problem hiding this comment.
🔴 Stuck setup wizards over SSH
With local rendering active, openHere offloads setup wizards. The streamed proxy blocks navigation to the next stage or editor because it uses another port. Wizard actions that call Pane.close also leave the window open.
Learn more
The import and shortcut wizards run on separate loopback HTTP servers. runOnboarding opens the first wizard in a pane, then returns the next wizard or editor URL to that same window. The import page and shortcuts page navigate to that URL. The streamed window proxies only the initial port, so every transition to another server fails. In the standalone shortcut wizard, runManager calls Pane.close() when the user finishes without navigating, but the offloaded branch never installs a close callback.
Example: Run terminal-code --shortcut-setup over SSH with a working rendering link and resolve a shortcut conflict. Applying the changes and continuing sends the window to the editor's port, which the proxy rejects. Quitting without applying instead leaves the wizard open because the pane cannot close it.
Recommended fix: Keep wizard windows on the existing renderer by making offloading opt-in for editor launches. To offload wizards too, provide a stop callback and explicitly support transitions between approved endpoints.
Was this helpful? React with 👍 or 👎 to provide feedback.
| proxy: `socks5://127.0.0.1:${front.port}`, | ||
| partition: partitionFor(target.host), |
There was a problem hiding this comment.
🔴 Closing a second editor breaks the first
Opening two offloaded windows from one server makes streamedWindow assign the second window’s proxy to their shared browser session. Closing the second window shuts down that proxy, so new requests from the first window fail.
Learn more
Each streamed window creates a SOCKS listener tied to its own rendering link and closes that listener when the window exits. The daemon’s WebView passes the proxy and partition to Pixel. Pixel 0.3.3 applies the proxy with Electron’s session.setProxy, so it affects the entire browser session, not just one window. Both windows use the same persistent session when their server host matches. The first window retains no way to restore its original proxy when the second window exits.
Example: Open two projects from the same SSH host in separate terminal panes. Close the second editor, then reload the first. Its browser session tries to connect through the closed SOCKS listener.
Recommended fix: Give each active offloaded window its own browser session, or share one proxy with the same lifetime as the shared session.
Was this helpful? React with 👍 or 👎 to provide feedback.
| async function stopStray(): Promise<void> { | ||
| const state = listenerState(); | ||
| if (state && state.pid !== process.pid && alive(state.pid)) await kill(state.pid); | ||
| } |
There was a problem hiding this comment.
🔴 Unrelated process termination after PID reuse
After a listener crash and PID reuse, stopStray treats any live process at the saved PID as the listener. kill terminates that process, even when it belongs to another application.
Learn more
The listener records its PID on disk. It removes that record in its signal handlers, which do not run after a hard kill or abrupt shutdown. Later, installService or removeService attempts to stop the recorded process. alive checks only that the PID exists, not that the process is the old listener. kill sends SIGTERM and follows with SIGKILL if the process remains.
Example: The listener is killed and leaves PID 1234 in its state file. After the OS assigns PID 1234 to a user-owned editor, rerunning the enable command terminates that editor instead.
Recommended fix: Use the service manager to stop managed listeners. For a detached listener, verify process identity and a recorded start identifier before signaling it, or use a private control socket rather than a persisted PID.
Was this helpful? React with 👍 or 👎 to provide feedback.
| export function targets(enabled = readSettings().enabled): Target[] { | ||
| const found: Target[] = tunnelSockets().map((socketFile) => ({ | ||
| route: "tunnel" as const, | ||
| label: `ssh tunnel ${path.basename(socketFile)}`, | ||
| connect: { path: socketFile }, | ||
| socketFile, | ||
| })); | ||
| const address = enabled ? localAddress() : null; |
There was a problem hiding this comment.
🟡 Outgoing SSH offload stays enabled
After disableCommand runs on the SSH server, targets still returns open SSH tunnels. New editor launches keep rendering locally through those tunnels.
| export function targets(enabled = readSettings().enabled): Target[] { | |
| const found: Target[] = tunnelSockets().map((socketFile) => ({ | |
| route: "tunnel" as const, | |
| label: `ssh tunnel ${path.basename(socketFile)}`, | |
| connect: { path: socketFile }, | |
| socketFile, | |
| })); | |
| const address = enabled ? localAddress() : null; | |
| export function targets(enabled = readSettings().enabled): Target[] { | |
| if (!enabled) return []; | |
| const found: Target[] = tunnelSockets().map((socketFile) => ({ | |
| route: "tunnel" as const, | |
| label: `ssh tunnel ${path.basename(socketFile)}`, | |
| connect: { path: socketFile }, | |
| socketFile, | |
| })); | |
| const address = localAddress(); |
Was this helpful? React with 👍 or 👎 to provide feedback.
| const REMOTE_SCRIPT = [ | ||
| `tc="$HOME/.local/bin/terminal-code"`, | ||
| `[ -x "$tc" ] || tc="$HOME/.local/bin/tode"`, | ||
| `[ -x "$tc" ] || { echo "terminal-code-missing" >&2; exit 127; }`, | ||
| `exec "$tc" --local-rendering-tunnel`, |
There was a problem hiding this comment.
🟡 SSH setup misses custom installs
When the server uses a custom bin directory, REMOTE_SCRIPT ignores it and searches only the default directory. Setup reports terminal-code missing even when it is on the remote PATH.
Learn more
The installer accepts XDG_BIN_HOME and copies both shims there. SSH setup starts the tunnel using a remote shell script that looks only under ~/.local/bin. The script ignores both XDG_BIN_HOME and the remote PATH, then reports a missing install.
Example: Install terminal-code on the server with XDG_BIN_HOME=$HOME/bin and expose that directory in the remote command environment. Running terminal-code --setup-ssh user@server still reports that terminal-code is missing.
Recommended fix: Resolve both aliases through the configured bin directory and the remote PATH, keeping the default directory as a fallback for noninteractive SSH shells.
Was this helpful? React with 👍 or 👎 to provide feedback.
| export function targets(enabled = readSettings().enabled): Target[] { | ||
| const found: Target[] = tunnelSockets().map((socketFile) => ({ | ||
| route: "tunnel" as const, | ||
| label: `ssh tunnel ${path.basename(socketFile)}`, | ||
| connect: { path: socketFile }, | ||
| socketFile, | ||
| })); | ||
| const address = enabled ? localAddress() : null; | ||
| if (address) { | ||
| found.push({ | ||
| route: "direct", | ||
| label: `${address.includes(":") ? `[${address}]` : address}:${pairPort()}`, | ||
| connect: { host: address, port: pairPort() }, |
There was a problem hiding this comment.
🔍 Tunnel priority contradicts the README
targets puts SSH tunnels first, and renderLocally tries them in order. The SSH guide says direct connections come first.
Was this helpful? React with 👍 or 👎 to provide feedback.
| function thisServer(): string { | ||
| const server = sshEndpoints()?.server ?? os.hostname(); | ||
| return `${os.userInfo().username}@${server.includes(":") ? `[${server}]` : server}`; | ||
| } |
There was a problem hiding this comment.
🔍 Unusable SSH recovery commands
thisServer drops the SSH port and emits bracketed IPv6 destinations. The setup command uses Pixel’s parser, which rejects those IPv6 destinations.
Was this helpful? React with 👍 or 👎 to provide feedback.
- server only connects directly to tailnet (or trusted) addresses - each streamed editor gets its own browser session - --setup-ssh keeps the destination typed at its prompt - only editor launches render locally, not the setup wizards - verify the listener pid before killing it - disabling local rendering on a server also stops tunnels - --setup-ssh finds installs on XDG_BIN_HOME and PATH - upgrade and install restart the listener - suggested --setup-ssh commands keep the ssh port and parse ipv6
This PR uses a new pixel features which allows inside certain terminal environments for terminal-code running over
sshto render locally, allowing for significantly higher FPSThis PR also bumps pixel, which includes significant performance improvements for terminal-code over ssh without local rendering, and inside the rex terminal
This will resolve #19 when herdr releases a passthrough mode for kitty graphics