Skip to content

Commit 0b978fd

Browse files
committed
Merge remote-tracking branch 'origin/main' into issue-315
# Conflicts: # packages/app/src/docker-git/program-auth.ts # packages/app/tests/docker-git/core-templates.test.ts # packages/lib/src/usecases/auth-grok-oauth.ts # packages/lib/tests/core/templates.test.ts
2 parents 9622a1e + 7b45d70 commit 0b978fd

40 files changed

Lines changed: 660 additions & 162 deletions
299 KB
Loading
105 KB
Loading
290 KB
Loading
311 KB
Loading
146 KB
Loading

packages/api/src/services/terminal-sessions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,12 @@ export const renderTmuxAttachCommand = (
976976
`if ! command -v tmux >/dev/null 2>&1; then printf '%s\\n' ${
977977
shellQuote(args.missingMessage ?? tmuxMissingMessage)
978978
} >&2; exit 127; fi`,
979-
`tmux has-session -t ${shellQuote(args.tmuxName)} 2>/dev/null || tmux new-session -d -s ${
979+
`tmux has-session -t ${shellQuote(args.tmuxName)} 2>/dev/null || tmux start-server \\; set-option -g history-limit 50000 \\; new-session -d -s ${
980980
shellQuote(args.tmuxName)
981981
} -c ${shellQuote(args.targetDir)}`,
982982
`tmux set-option -t ${shellQuote(args.tmuxName)} status off >/dev/null 2>&1 || true`,
983+
`tmux set-option -t ${shellQuote(args.tmuxName)} history-limit 50000 >/dev/null 2>&1 || true`,
984+
`tmux set-option -t ${shellQuote(args.tmuxName)} mouse on >/dev/null 2>&1 || true`,
983985
`exec tmux attach-session -t ${shellQuote(args.tmuxName)}`
984986
].join("; ")
985987
return `bash --noprofile --norc -lc ${shellQuote(script)}`

packages/api/tests/terminal-sessions.test.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,38 @@ describe("terminal sessions service", () => {
247247
expect(command).toContain("command -v tmux")
248248
expect(command).toContain("bash --noprofile --norc -lc")
249249
expect(command).toContain("tmux missing")
250-
expect(command).toContain("tmux new-session -d -s")
250+
expect(command).toContain("tmux start-server")
251+
expect(command).toContain("set-option -g history-limit 50000")
252+
expect(command).toContain("new-session -d -s")
251253
expect(command).toContain("tmux set-option")
252254
expect(command).toContain("status off")
255+
expect(command).toContain("history-limit 50000")
256+
expect(command).toContain("mouse on")
253257
expect(command).toContain("tmux attach-session -t")
254258
expect(command).toContain("docker-git-session-1")
255259
expect(command).toContain("/home/dev/project with spaces")
260+
261+
const startServerIndex = command.indexOf("tmux start-server")
262+
const globalHistoryLimitIndex = command.indexOf("set-option -g history-limit 50000")
263+
const newSessionIndex = command.indexOf("new-session -d -s")
264+
const statusOffIndex = command.indexOf("status off")
265+
const sessionHistoryLimitIndex = command.lastIndexOf("history-limit 50000")
266+
const mouseOnIndex = command.indexOf("mouse on")
267+
const attachSessionIndex = command.indexOf("tmux attach-session -t")
268+
269+
expect(startServerIndex).toBeGreaterThanOrEqual(0)
270+
expect(globalHistoryLimitIndex).toBeGreaterThanOrEqual(0)
271+
expect(newSessionIndex).toBeGreaterThanOrEqual(0)
272+
expect(statusOffIndex).toBeGreaterThanOrEqual(0)
273+
expect(sessionHistoryLimitIndex).toBeGreaterThanOrEqual(0)
274+
expect(mouseOnIndex).toBeGreaterThanOrEqual(0)
275+
expect(attachSessionIndex).toBeGreaterThanOrEqual(0)
276+
expect(startServerIndex).toBeLessThan(globalHistoryLimitIndex)
277+
expect(globalHistoryLimitIndex).toBeLessThan(newSessionIndex)
278+
expect(newSessionIndex).toBeLessThan(statusOffIndex)
279+
expect(statusOffIndex).toBeLessThan(sessionHistoryLimitIndex)
280+
expect(sessionHistoryLimitIndex).toBeLessThan(mouseOnIndex)
281+
expect(mouseOnIndex).toBeLessThan(attachSessionIndex)
256282
})
257283

258284
it("fails before creating a durable session when tmux is unavailable", async () => {

packages/app/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# @prover-coder-ai/docker-git
22

3+
## 1.1.22
4+
5+
### Patch Changes
6+
7+
- chore: automated version bump
8+
9+
- Updated dependencies []:
10+
- @prover-coder-ai/docker-git-session-sync@1.0.25
11+
12+
## 1.1.21
13+
14+
### Patch Changes
15+
16+
- chore: automated version bump
17+
18+
- Updated dependencies []:
19+
- @prover-coder-ai/docker-git-session-sync@1.0.24
20+
321
## 1.1.20
422

523
### Patch Changes

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prover-coder-ai/docker-git",
3-
"version": "1.1.20",
3+
"version": "1.1.22",
44
"description": "docker-git Bun and Gridland CLI plus browser frontend",
55
"main": "dist/src/docker-git/main.js",
66
"bin": {

packages/app/src/docker-git/api-client-auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import type {
2525
AuthGithubLoginCommand,
2626
AuthGithubLogoutCommand,
2727
AuthGithubStatusCommand,
28-
AuthGrokLogoutCommand,
29-
AuthGrokStatusCommand,
3028
AuthGitlabLoginCommand,
3129
AuthGitlabLogoutCommand,
32-
AuthGitlabStatusCommand
30+
AuthGitlabStatusCommand,
31+
AuthGrokLogoutCommand,
32+
AuthGrokStatusCommand
3333
} from "./frontend-lib/core/domain.js"
3434
import { resolvePathFromCwd } from "./frontend-lib/usecases/path-helpers.js"
3535
import type { ApiAuthRequiredError, ApiRequestError } from "./host-errors.js"

0 commit comments

Comments
 (0)