Skip to content

Commit 46f6880

Browse files
skulidropekclaude
andcommitted
fix(app): SSH config includes RemoteCommand for auto cd into project
Adds RemoteCommand and RequestTTY yes to the host SSH config entry so plain `ssh dev@HOST` opens a shell directly in the project folder. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6a49c57 commit 46f6880

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/app/src/web/app-ready-terminal-pane.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ type CfTunnelState =
167167
| { readonly tag: "ready"; readonly hostname: string; readonly sshPassword: string }
168168
| { readonly tag: "failed" }
169169

170-
const hostSshConfig = (hostname: string): string =>
171-
`Host ${hostname}\n ProxyCommand cloudflared access ssh --hostname %h\n StrictHostKeyChecking no\n UserKnownHostsFile /dev/null`
170+
const hostSshConfig = (hostname: string, targetDir: string): string =>
171+
`Host ${hostname}\n ProxyCommand cloudflared access ssh --hostname %h\n StrictHostKeyChecking no\n UserKnownHostsFile /dev/null\n RemoteCommand cd ${targetDir} && exec $SHELL\n RequestTTY yes`
172172

173173
const copyText = (text: string): void => { void navigator.clipboard.writeText(text).catch(() => {}) }
174174

@@ -211,9 +211,9 @@ const VsCodeAccessPanel = (
211211
readonly onRetry: () => void
212212
}
213213
): JSX.Element => {
214-
const cfSshConfig = cfState.tag === "ready" ? hostSshConfig(cfState.hostname) : null
214+
const cfSshConfig = cfState.tag === "ready" ? hostSshConfig(cfState.hostname, info.targetDir) : null
215215
const cfSshCommand = cfState.tag === "ready"
216-
? `ssh -t ${info.sshUser}@${cfState.hostname} "cd ${info.targetDir} && exec \\$SHELL"`
216+
? `ssh ${info.sshUser}@${cfState.hostname}`
217217
: null
218218
const cfVscodeUri = cfState.tag === "ready"
219219
? `vscode://ms-vscode-remote.remote-ssh/open?hostName=${encodeURIComponent(`${info.sshUser}@${cfState.hostname}`)}&folder=${encodeURIComponent(info.targetDir)}`

0 commit comments

Comments
 (0)