Skip to content

Commit 6d8ddcf

Browse files
committed
fix: terminal issues
- hanging on consecutive commands - Windows not detecting cwd
1 parent b56a7c2 commit 6d8ddcf

File tree

3 files changed

+233
-101
lines changed

3 files changed

+233
-101
lines changed

codebuff.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,46 @@
1515
"fileChangeHooks": [
1616
{
1717
"name": "backend-unit-tests",
18-
"command": "set -o pipefail && bun test $(find src -name *.test.ts ! -name *.integration.test.ts) 2>&1 | grep -Ev $'\\x1b\\[[0-9;]*m' | grep -Ev '^s*[0-9]+s+(pass|skip)|(pass)|(skip)' && bun run typecheck-only",
18+
"command": "set -o pipefail && bun test $(find src -name *.test.ts ! -name *.integration.test.ts) 2>&1 | grep -Ev '✓|\\(pass\\)'",
1919
"cwd": "backend",
2020
"filePattern": "backend/**/*.ts"
2121
},
22+
{
23+
"name": "backend-typecheck",
24+
"command": "bun run typecheck-only",
25+
"cwd": "backend",
26+
"filePattern": "backend/**/*.ts"
27+
},
28+
2229
{
2330
"name": "npm-app-unit-tests",
24-
"command": "set -o pipefail && bun test $(find src -name *.test.ts ! -name *.integration.test.ts) 2>&1 | grep -Ev $'\\x1b\\[[0-9;]*m' | grep -Ev '^s*[0-9]+s+(pass|skip)|(pass)|(skip)' && bun run typecheck-only",
31+
"command": "set -o pipefail && bun test $(find src -name *.test.ts ! -name *.integration.test.ts) 2>&1 | grep -Ev '✓|\\(pass\\)'",
32+
"cwd": "npm-app",
33+
"filePattern": "npm-app/**/*.ts"
34+
},
35+
{
36+
"name": "npm-typecheck",
37+
"command": "bun run typecheck-only",
2538
"cwd": "npm-app",
2639
"filePattern": "npm-app/**/*.ts"
2740
},
41+
42+
{
43+
"name": "web-typecheck",
44+
"command": "bun run typecheck-only",
45+
"cwd": "web",
46+
"filePattern": "web/**/*.ts"
47+
},
48+
2849
{
2950
"name": "common-unit-tests",
30-
"command": "set -o pipefail && bun test $(find src -name *.test.ts ! -name *.integration.test.ts) 2>&1 | grep -Ev $'\\x1b\\[[0-9;]*m' | grep -Ev '^s*[0-9]+s+(pass|skip)|(pass)|(skip)' && bun run typecheck-only",
51+
"command": "set -o pipefail && bun test $(find src -name *.test.ts ! -name *.integration.test.ts) 2>&1 | grep -Ev '✓|\\(pass\\)'",
52+
"cwd": "common",
53+
"filePattern": "common/**/*.ts"
54+
},
55+
{
56+
"name": "common-typecheck",
57+
"command": "bun run typecheck-only",
3158
"cwd": "common",
3259
"filePattern": "common/**/*.ts"
3360
}

common/src/util/string.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,13 @@ export const stripNullChars = (str: string): string => {
268268
return str.replace(/\u0000/g, '')
269269
}
270270

271-
const ansiRegex = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g
271+
const ansiColorsRegex = /\x1B\[[0-9;]*m/g
272272
export function stripColors(str: string): string {
273+
return str.replace(ansiColorsRegex, '')
274+
}
275+
276+
const ansiRegex = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x1B]*\x1B\\?)/g
277+
export function stripAnsi(str: string): string {
273278
return str.replace(ansiRegex, '')
274279
}
275280

0 commit comments

Comments
 (0)