It will work if you use your shell script rather than the binary.
$ ~/tmp/term_test$ cat ./test_wrapper.sh #!/bin/bash ./test << EOF 5 EOF read dummy $ gnome-terminal -x ./test_wrapper.sh $ The "read dummy" line I added will stop the terminal from immediately closing when the script completes.
Are you sure that you need to open a new terminal session?