Cosmo:~ tim$ cd /; ls
Applications etc
Developer home
Library installer.failurerequests
Network net
System opt
Users private
Volumes sbin
bin tmp
cores usr
dev var
Cosmo:/ tim$
Hello Tim,
Its an interactive shell mode 2.
I test with ifconfig, send it, the window shows the data and then I can not send another command.
this is using the sample of the interactive shell that ships with Xojo completely unmodified.
I am using the supplied example from examples>advanced>shell>Interactive Shell.xojo_binary_project
completely unmodified.
this is what sends the data:-
If Key = Chr(13) Then
If Not mShell.IsRunning Then
#If TargetWin32 Then
mShell.Execute(InputField.Text)
#Else
mShell.Execute("sh")
#Endif
End If
mShell.Write(InputField.Text)
mShell.Write(Chr(13))
InputField.Text = ""
Return True
Else
Return False
End If
which appears to be completely correct to my limited knowledge.
Although it does not use WriteLine it is obviously adding the required return character separately.
As mentioned, no issues at all on the Mac, but PI and my Linux Mint VM do not accept the second command sent, there is simply nothing that occurs.
No I did not try exactly that, I was innocently assuming the supplied examples would work.
I have managed to ignore shell for decades as I find it a staggeringly unmoving method of communicating with an OS.
Unfortunately I have to interact in this uninspiring way now to deal with PI.
Because of this I have absolutely zero idea what the formation of data sent to a shell should comprise, and searching for any information gives me nothing that I find useful.
For instance I am entirely unable to find any search string in duck duck that would allow me to find out how the shell requires to be addressed.
I do not know where to seek the knowledge about the required end of line character, nor any other element of the shell requirements.
And I do not mean sending commands, I mean the actual control characters unseen by the user when using a shell, such as the 10 and 13 to end a command.
And that brings me to the question, why does the supplied example work perfectly well on my Mac when using mShell.Write(Chr(13))
but does not, as seems to be the correct behaviour, on a Linux system.
Should the provided example shipped with Xojo be modified to work on all platforms so as to avoid confusion for anyone coming to this method of OS interaction?
It seems from my observations that you are something of a knowledgeable user of the shell.
May I ask if the results I received from a command within the Xojo shell, such as “Verify password:” or “$” can be relied upon to be static and allow me to parse the data for users who are unable to determine what the results mean.
I basically wish to remove any of my users having to go through the process of dealing with terminal and use the Pi like they would expect to, that is a simple GUI interface.