Skip to content

Commit b1fed2e

Browse files
committed
fix(desktop): make the tmux format frame with the shared random helper
1 parent 434bcd4 commit b1fed2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • apps/desktop/src/main/terminal

‎apps/desktop/src/main/terminal/tmux.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* of the shell that launched it.
1818
*/
1919
import { spawn } from 'node:child_process'
20-
import { randomBytes } from 'node:crypto'
2120
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
2221
import { tmpdir } from 'node:os'
2322
import { dirname, join } from 'node:path'
@@ -26,6 +25,7 @@ import type { TerminalPaneState } from '@sim/terminal-protocol'
2625
import { getErrorMessage } from '@sim/utils/errors'
2726
import { sleep } from '@sim/utils/helpers'
2827
import { generateId } from '@sim/utils/id'
28+
import { generateRandomHex } from '@sim/utils/random'
2929

3030
const logger = createLogger('DesktopTmux')
3131

@@ -56,7 +56,7 @@ const FIELD = '<~sim~>'
5656
* newline split are each unframed and dropped.
5757
*/
5858
function framedFormat(fields: string[]): { format: string; frame: string } {
59-
const frame = `<~${randomBytes(8).toString('hex')}~>`
59+
const frame = `<~${generateRandomHex(16)}~>`
6060
return { format: `${frame}${fields.join(FIELD)}${frame}`, frame }
6161
}
6262

0 commit comments

Comments
 (0)