diff --git a/components/fpdebug/app/fpdserver/debugthreadcommand.pas b/components/fpdebug/app/fpdserver/debugthreadcommand.pas index 22779ed6db..91dc2d2563 100644 --- a/components/fpdebug/app/fpdserver/debugthreadcommand.pas +++ b/components/fpdebug/app/fpdserver/debugthreadcommand.pas @@ -51,6 +51,18 @@ type property Filename: string read FFileName write FFileName; end; + { TFpDebugThreadSetRedirectConsoleOutputCommand } + + TFpDebugThreadSetConsoleTtyCommand = class(TFpDebugThreadCommand) + private + FConsoleTty: String; + public + function Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean; override; + class function TextName: string; override; + published + property ConsoleTty: String read FConsoleTty write FConsoleTty; + end; + { TFpDebugThreadRunCommand } TFpDebugThreadRunCommand = class(TFpDebugThreadCommand) @@ -195,6 +207,21 @@ implementation var GFpDebugThreadCommandList: TFpDebugThreadCommandList = nil; +{ TFpDebugThreadSetConsoleTtyCommand } + +function TFpDebugThreadSetConsoleTtyCommand.Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean; +begin + AController.ConsoleTty:=FConsoleTty; + AController.RedirectConsoleOutput:=(AController.ConsoleTty=''); + DoProcessLoop:=false; + result:=true; +end; + +class function TFpDebugThreadSetConsoleTtyCommand.TextName: string; +begin + result := 'setconsoletty'; +end; + { TFpDebugThreadStackTraceCommand } function TFpDebugThreadStackTraceCommand.Execute(AController: TDbgController; out DoProcessLoop: boolean): boolean; @@ -601,6 +628,7 @@ end; initialization TFpDebugThreadCommandList.instance.Add(TFpDebugThreadQuitDebugServerCommand); TFpDebugThreadCommandList.instance.Add(TFpDebugThreadSetFilenameCommand); + TFpDebugThreadCommandList.instance.Add(TFpDebugThreadSetConsoleTtyCommand); TFpDebugThreadCommandList.instance.Add(TFpDebugThreadRunCommand); TFpDebugThreadCommandList.instance.Add(TFpDebugThreadContinueCommand); TFpDebugThreadCommandList.instance.Add(TFpDebugThreadStepOverInstrCommand);