Dim p as Process
p = TerminalView1.Shell("my/command")
While p.state = Process.Running
Wait 0.1
Wend
Viewing bash/php scripts in real time
- BruceSteers
- Posts: 1877
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Viewing bash/php scripts in real time
Another option could be to use a TerminalView not a TextArea you could then just run the script in the terminalview and see the normal terminal output.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Viewing bash/php scripts in real time
I'll play with terminal view and see if that works. Thanks Bruce!BruceSteers wrote: ↑Saturday 25th May 2024 12:45am Another option could be to use a TerminalView not a TextArea you could then just run the script in the terminalview and see the normal terminal output.
Dim p as Process p = TerminalView1.Shell("my/command") While p.state = Process.Running Wait 0.1 Wend
Re: Viewing bash/php scripts in real time
Hey Bruce, I like the terminalview and have made some changes to my back end scripts to make this work. Just one small problem: with longer running scripts, the terminalview eventually stops scrolling down and I can't tell if the script has finished without scrolling down manually. Is there a way to auto scroll to the bottom until the script finishes?rj71 wrote: ↑Saturday 25th May 2024 3:21pmI'll play with terminal view and see if that works. Thanks Bruce!BruceSteers wrote: ↑Saturday 25th May 2024 12:45am Another option could be to use a TerminalView not a TextArea you could then just run the script in the terminalview and see the normal terminal output.
Dim p as Process p = TerminalView1.Shell("my/command") While p.state = Process.Running Wait 0.1 Wend
Re: Viewing bash/php scripts in real time
Ah, I see the .ensurevisible now. Sweet!
- BruceSteers
- Posts: 1877
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Viewing bash/php scripts in real time
You got it, EnsureVisiblerj71 wrote: ↑Saturday 25th May 2024 10:10pmHey Bruce, I like the terminalview and have made some changes to my back end scripts to make this work. Just one small problem: with longer running scripts, the terminalview eventually stops scrolling down and I can't tell if the script has finished without scrolling down manually. Is there a way to auto scroll to the bottom until the script finishes?rj71 wrote: ↑Saturday 25th May 2024 3:21pmI'll play with terminal view and see if that works. Thanks Bruce!BruceSteers wrote: ↑Saturday 25th May 2024 12:45am Another option could be to use a TerminalView not a TextArea you could then just run the script in the terminalview and see the normal terminal output.
Dim p as Process p = TerminalView1.Shell("my/command") While p.state = Process.Running Wait 0.1 Wend
I found the same with TerminalView, mostly it's fine but occasionally it misses a scroll and then stops scrolling with the output.
I do something like this...
Public hProc As Process
Public hObs As Observer
Public Sub RunCommand(sCommand)
hProc = TerminalView1.Shell(sCommand)
hObs = New Observer(hProc) As "PROC" ' Observe hProc events as PROC_EventName
End
Public Sub PROC_Read() ' Trigger EnsureVisible on each Read event.
TerminalView1.EnsureVisible()
End
' Detect when the command process ends and kill the event observer.
' PS. TerminalView1_Kill() does the same for this but we have a process event observer so I'll use that.
Public Sub PROC_Kill()
hObs = Null
End
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Viewing bash/php scripts in real time
Thanks Bruce. I'll try this bit of code because I did a test this morning and the terminalview stopped auto scrolling down on a very long running script. I'll take a look at it tomorrow because it's Indy 500 day and I got some meats to grill and some racing to watchBruceSteers wrote: ↑Sunday 26th May 2024 9:01amYou got it, EnsureVisiblerj71 wrote: ↑Saturday 25th May 2024 10:10pmHey Bruce, I like the terminalview and have made some changes to my back end scripts to make this work. Just one small problem: with longer running scripts, the terminalview eventually stops scrolling down and I can't tell if the script has finished without scrolling down manually. Is there a way to auto scroll to the bottom until the script finishes?
I found the same with TerminalView, mostly it's fine but occasionally it misses a scroll and then stops scrolling with the output.
I do something like this...
Public hProc As Process Public hObs As Observer Public Sub RunCommand(sCommand) hProc = TerminalView1.Shell(sCommand) hObs = New Observer(hProc) As "PROC" ' Observe hProc events as PROC_EventName End Public Sub PROC_Read() ' Trigger EnsureVisible on each Read event. TerminalView1.EnsureVisible() End ' Detect when the command process ends and kill the event observer. ' PS. TerminalView1_Kill() does the same for this but we have a process event observer so I'll use that. Public Sub PROC_Kill() hObs = Null End
Re: Viewing bash/php scripts in real time
So I tried the code on a really long running script last night. The terminal view at some point stopped scrolling and even looked like it stop responding. I wasn't watching it so I don't know exactly how long the script ran before this happened. Not much I can do about the script, its just something that will take a long time to complete, so I guess its back to the drawing board for this project.