Xterm interception

Linux specific forum
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

Xterm interception

Post by rndrei »

How can I intercept the input information on the screen of a console program and display it in EditorGadget
For example, there is a console program:

Code: Select all

PrintN("Enter your name?:")
Input()
There is a second program:

Code: Select all

 Compiler = RunProgram(#PB_Compiler_Home+"compilers/pbcompiler", "-h", "", #PB_Program_Open | #PB_Program_Read)
  Output$ = ""
  If Compiler
    While ProgramRunning(Compiler)
      If AvailableProgramOutput(Compiler)
        Output$ + ReadProgramString(Compiler) + Chr(13)
      EndIf
    Wend
    Output$ + Chr(13) + Chr(13)
    Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
    CloseProgram(Compiler) ; Close the connection to the program
  EndIf
    MessageRequester("Output", Output$)
How to interception INPUT STRING from the first program in the EditorGadget window ?