The
openDocument function uses
TProcessUTF8 under the hood. The code of
openDocument first tries to locate a launcher (
xdg-open in my case) and then it creates a command line like this:
BrowserProcess.CommandLine := '/usr/bin/xdg-open ''/home/myuser/Documents/mydocument.txt'''
Then it calls:
When I run the same command (
/usr/bin/xdg-open '/home/myuser/Documents/mydocument.txt') under
bash, I see that it returns immediately (with return status of 0) even after it starts the appropriate text editor in the background as expected. So, the
Execute method of
TProcessUTF8 should wait and read the return status of the
xdg-open ... command. However, I think is does
not. I was not able to trace this, because the debugger did not enter into the source code (?) of
TProcessUTF8.Execute (that is, the statement,
BrowserProcess.Execute).