@travetto/terminal 3.0.0-rc.8 → 3.0.0-rc.9
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.
- package/package.json +1 -1
- package/src/operation.ts +1 -1
- package/src/terminal.ts +1 -1
- package/src/types.ts +1 -1
package/package.json
CHANGED
package/src/operation.ts
CHANGED
|
@@ -103,7 +103,7 @@ export class TerminalOperation {
|
|
|
103
103
|
const commitLine = async (): Promise<void> => {
|
|
104
104
|
await writer?.();
|
|
105
105
|
if (line) {
|
|
106
|
-
const msg = cfg.
|
|
106
|
+
const msg = cfg.committedPrefix ? `${cfg.committedPrefix} ${line}` : line;
|
|
107
107
|
if (cfg.position === 'inline') {
|
|
108
108
|
await TerminalWriter.for(term).setPosition({ x: 0 }).changePosition({ y: -1 }).writeLine(msg).commit();
|
|
109
109
|
} else {
|
package/src/terminal.ts
CHANGED
|
@@ -132,7 +132,7 @@ export class Terminal implements TermState {
|
|
|
132
132
|
if (!this.interactive) {
|
|
133
133
|
for await (const line of lines) {
|
|
134
134
|
if (line !== undefined) {
|
|
135
|
-
const out = config.
|
|
135
|
+
const out = config.committedPrefix ? `${config.committedPrefix} ${line}` : line;
|
|
136
136
|
await this.writeLines(out);
|
|
137
137
|
}
|
|
138
138
|
}
|
package/src/types.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type TerminalTableEvent = { idx: number, text: string, done?: boolean };
|
|
|
13
13
|
export type TerminalTableConfig = { header?: string[], forceNonInteractiveOrder?: boolean };
|
|
14
14
|
export type TerminalProgressEvent = { idx: number, total?: number, text?: string };
|
|
15
15
|
export type TerminalProgressRender = (ev: TerminalProgressEvent) => string;
|
|
16
|
-
export type TerminalWaitingConfig = { position?: TermLinePosition, end?: boolean,
|
|
16
|
+
export type TerminalWaitingConfig = { position?: TermLinePosition, end?: boolean, committedPrefix?: string } & DelayedConfig;
|
|
17
17
|
|
|
18
18
|
export type TermColorLevel = 0 | 1 | 2 | 3;
|
|
19
19
|
export type TermColorScheme = 'dark' | 'light';
|