I have made a small Snake game using C. When I open it via GUI (Nemo), nothing gets opened. But if I open it using the terminal, it works as expected. I've tried it on multiple computers with different OSes (Ubuntu, Mint etc) but all exhibit the same problem.
I also tried right clicking the file, selecting 'Open with other application' and typing the following in the 'Enter custom command to execute' textbox:
gnome-terminal --working-directory ~/Downloads/My\ Programs/Snake -e "/bin/bash -c './Snake && read'"
and then tried opening the executable. Still, nothing happens.
But executing the same command using the terminal works perfectly. Permissions set for the
Snake executable file are
-rwxr-xr-x and its type is
Program (application/x-executable). Also,
$ file Snake Snake: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=c609e53bda05544c647aab2a19aa865af6dc93c2, not stripped
What could be the problem?