codify-plugin-lib 1.0.182-beta56 → 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.
@@ -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
- const initialCols = 10_000; // Set to a really large value to prevent wrapping
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.182-beta56",
3
+ "version": "1.0.182-beta57",
4
4
  "description": "Library plugin library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
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
- const initialCols = 10_000; // Set to a really large value to prevent wrapping
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;