codify-plugin-lib 1.0.182-beta55 → 1.0.182-beta57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,6 +20,7 @@ export class BackgroundPty {
|
|
|
20
20
|
historyIgnore = Utils.getShell() === Shell.ZSH ? { HISTORY_IGNORE: '*' } : { HISTIGNORE: '*' };
|
|
21
21
|
basePty = pty.spawn(this.getDefaultShell(), ['-i'], {
|
|
22
22
|
env: { ...process.env, ...this.historyIgnore },
|
|
23
|
+
cols: 10_000, // Set to a really large value to prevent wrapping
|
|
23
24
|
name: nanoid(6),
|
|
24
25
|
handleFlowControl: true
|
|
25
26
|
});
|
package/dist/pty/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ export declare enum SpawnStatus {
|
|
|
21
21
|
*
|
|
22
22
|
* @property {boolean} [interactive] - Indicates whether the spawned process needs
|
|
23
23
|
* to be interactive. Only works within apply (not plan). Defaults to true.
|
|
24
|
+
*
|
|
25
|
+
* @property {boolean} [disableWrapping] - Forces the terminal width to 10_000 to disable wrapping.
|
|
26
|
+
* In applys, this is off by default while it is on during plans.
|
|
24
27
|
*/
|
|
25
28
|
export interface SpawnOptions {
|
|
26
29
|
cwd?: string;
|
|
@@ -28,6 +31,7 @@ export interface SpawnOptions {
|
|
|
28
31
|
interactive?: boolean;
|
|
29
32
|
requiresRoot?: boolean;
|
|
30
33
|
stdin?: boolean;
|
|
34
|
+
disableWrapping?: boolean;
|
|
31
35
|
}
|
|
32
36
|
export declare class SpawnError extends Error {
|
|
33
37
|
data: string;
|
|
@@ -49,7 +49,8 @@ export class SequentialPty {
|
|
|
49
49
|
...historyIgnore
|
|
50
50
|
};
|
|
51
51
|
// Initial terminal dimensions
|
|
52
|
-
|
|
52
|
+
// Set to a really large value to prevent wrapping
|
|
53
|
+
const initialCols = options?.disableWrapping ? 10_000 : process.stdout.columns ?? 80;
|
|
53
54
|
const initialRows = process.stdout.rows ?? 24;
|
|
54
55
|
const args = options?.interactive ? ['-i', '-c', cmd] : ['-c', cmd];
|
|
55
56
|
// Run the command in a pty for interactivity
|
|
@@ -67,7 +68,7 @@ export class SequentialPty {
|
|
|
67
68
|
});
|
|
68
69
|
const resizeListener = () => {
|
|
69
70
|
const { columns, rows } = process.stdout;
|
|
70
|
-
mPty.resize(columns, rows);
|
|
71
|
+
mPty.resize(columns, options?.disableWrapping ? 10_000 : rows);
|
|
71
72
|
};
|
|
72
73
|
// Listen to resize events for the terminal window;
|
|
73
74
|
process.stdout.on('resize', resizeListener);
|
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -7,7 +7,7 @@ import typescript from '@rollup/plugin-typescript';
|
|
|
7
7
|
export default {
|
|
8
8
|
input: 'src/index.ts',
|
|
9
9
|
output: {
|
|
10
|
-
dir:'dist',
|
|
10
|
+
dir: 'dist',
|
|
11
11
|
format: 'cjs',
|
|
12
12
|
inlineDynamicImports: true,
|
|
13
13
|
},
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
plugins: [
|
|
16
16
|
json(),
|
|
17
17
|
nodeResolve({ exportConditions: ['node'] }),
|
|
18
|
-
typescript({
|
|
18
|
+
typescript({
|
|
19
19
|
exclude: ['**/*.test.ts', '**/*.d.ts', 'test']
|
|
20
20
|
}),
|
|
21
21
|
commonjs(),
|
|
@@ -23,6 +23,7 @@ export class BackgroundPty implements IPty {
|
|
|
23
23
|
private historyIgnore = Utils.getShell() === Shell.ZSH ? { HISTORY_IGNORE: '*' } : { HISTIGNORE: '*' };
|
|
24
24
|
private basePty = pty.spawn(this.getDefaultShell(), ['-i'], {
|
|
25
25
|
env: { ...process.env, ...this.historyIgnore },
|
|
26
|
+
cols: 10_000, // Set to a really large value to prevent wrapping
|
|
26
27
|
name: nanoid(6),
|
|
27
28
|
handleFlowControl: true
|
|
28
29
|
});
|
package/src/pty/index.ts
CHANGED
|
@@ -25,6 +25,9 @@ export enum SpawnStatus {
|
|
|
25
25
|
*
|
|
26
26
|
* @property {boolean} [interactive] - Indicates whether the spawned process needs
|
|
27
27
|
* to be interactive. Only works within apply (not plan). Defaults to true.
|
|
28
|
+
*
|
|
29
|
+
* @property {boolean} [disableWrapping] - Forces the terminal width to 10_000 to disable wrapping.
|
|
30
|
+
* In applys, this is off by default while it is on during plans.
|
|
28
31
|
*/
|
|
29
32
|
export interface SpawnOptions {
|
|
30
33
|
cwd?: string;
|
|
@@ -32,6 +35,7 @@ export interface SpawnOptions {
|
|
|
32
35
|
interactive?: boolean;
|
|
33
36
|
requiresRoot?: boolean;
|
|
34
37
|
stdin?: boolean;
|
|
38
|
+
disableWrapping?: boolean;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
export class SpawnError extends Error {
|
|
@@ -62,7 +62,8 @@ export class SequentialPty implements IPty {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// Initial terminal dimensions
|
|
65
|
-
|
|
65
|
+
// Set to a really large value to prevent wrapping
|
|
66
|
+
const initialCols = options?.disableWrapping ? 10_000 : process.stdout.columns ?? 80
|
|
66
67
|
const initialRows = process.stdout.rows ?? 24;
|
|
67
68
|
|
|
68
69
|
const args = options?.interactive ? ['-i', '-c', cmd] : ['-c', cmd]
|
|
@@ -85,7 +86,7 @@ export class SequentialPty implements IPty {
|
|
|
85
86
|
|
|
86
87
|
const resizeListener = () => {
|
|
87
88
|
const { columns, rows } = process.stdout;
|
|
88
|
-
mPty.resize(columns, rows);
|
|
89
|
+
mPty.resize(columns, options?.disableWrapping ? 10_000 : rows);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
// Listen to resize events for the terminal window;
|