提交 84815709 编写于 作者: D Daniel Imms

Support IShellLaunchConfig.initialText

Fixes #22377
上级 6cb6a82f
......@@ -102,6 +102,13 @@ export interface IShellLaunchConfig {
ignoreConfigurationCwd?: boolean;
/** Whether to wait for a key press before closing the terminal. */
waitOnExit?: boolean;
/**
* A string including ANSI escape sequences that will be written to the terminal emulator
* _before_ the terminal process has launched, a trailing \n is added at the end of the string.
* This allows for example the terminal instance to display a styled message as the first line
* of the terminal. Use \x1b over \033 or \e for the escape control character.
*/
initialText?: string;
}
export interface ITerminalService {
......
......@@ -192,6 +192,9 @@ export class TerminalInstance implements ITerminalInstance {
this._xterm = xterm({
scrollback: this._configHelper.config.scrollback
});
if (this._shellLaunchConfig.initialText) {
this._xterm.writeln(this._shellLaunchConfig.initialText);
}
this._process.on('message', (message) => this._sendPtyDataToXterm(message));
this._xterm.on('data', (data) => {
if (this._process) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册