Xojo, Linux, Shell command leaves a zombie process

I thought it might be occasionally convenient to be able to put the Native Path to a file or directory icon onto the clipboard in one quick step. In a new Xojo project, I put one line of code into OpenDocument and made a short method "CopyPath(path as String):


CopyPath(Path as String):
Dim sh as new shell
sh.Execute(“echo -n " + Chr(34) + Path + Chr(34) + " | xclip -selection clipboard”)

I put a launcher to the program on the desktop and it works fine. Except, that after it runs, it leasves the app process running (sleeping, 21MB of memory usage) and a Bash process running (zombie and N/A memory used). If I drag more files, one at a time, it still leaves only those two processes, not multiples.

If I comment out the “sh.Execute . . .” line, it does not leave anything running.
Is there something other than sh.close that will stop it? Any other ideas?

Xojo 2016r4 ( have licesnes up to 2019)
Debian 10 Linux and also happens on Mint 20, both with MATE

Thank you for your time,

Don Jungk

I’m not sure about the zombie shell processes but there is an API to put stuff on the clipboard:

dim oClip as new Clipboard
oClip.Text = fTarget.NativePath

Hi Tim,
yes, thanks. I forgot to mention why I’m not using that.
On my Linux systems, if I put something on the clipboard that way, the clipboard is cleared when the app closes. This is true of most, but not all of the Linux progams that I have, not just Xojo apps. By using the xclip method, it persists, which is what I am trying to do. I assume that there is a declare to get around that, but I haven’t found it.
Also, typing the shell command into a terminal window does not leave the zombie process.


Off the top of my head, have you tried issuing an Exit command in the shell before closing it?

I quickly googled the clipboard problem and found this:

Hi Jay and Tim.
The exit command didn’t, but the link to the article seems to have a lot of information. Parcellite will probabally work for me as it will fix a lot of programs. Thank you. I didn’t think to use the word "persistent when I searched. Thank you.


Tim’s information gave me a way to do what I was trying to do, but there does still be a problem with the Xojo shell (with the versions that I have, up to 2019). I just checked a few other apps that I wrote and it seems they too leave a zombie bash process. I would guess it is not going to be an issue in most cases, just something curious.

Thanks Jay and Tim,