Caja open-with custom command--pass current directory and filename to command line

I would like to modify the open-with binding of caja such that binaries compiled with gcc are opened in mate-terminal, in the directory of the binary, and run leaving the terminal window open after completion.

If I right-click on the file, "Open With Other Application...," ">Use a custom command," and choose:

mate-terminal

for the custom command, I feel like I am well on my way. Now I just need to know how to pass the filename and current directory to mate-terminal. I've tried things like:

mate-terminal -e $1 -hold

and so forth, but so far to no avail. even at the command line:

temp@ubuntu:/c/z/scripts/mate/helloc$ xterm -e ./a.out -fs 100 -hold
temp@ubuntu:/c/z/scripts/mate/helloc$

Doesn't seem to take the fontsize or hold options. Are these things that should work, or am I barking up trees with no squirrels? Thanks!