tomlau10 / gcc-make-run

Compile-run C/C++ source code and execute Makefile in Atom.
https://atom.io/packages/gcc-make-run
MIT License
24 stars 10 forks source link

xterm and hold #3

Closed nilosweden closed 8 years ago

nilosweden commented 8 years ago

Ill much rather go with

when 'linux' then info.cmd = "xterm -e $SHELL -c './#{info.exe} #{info.env.ARGS} ; read -p \"Press ENTER to continue...\"'"

when normal run is triggered. Makes more sense than to hold the terminal open forever.

tomlau10 commented 8 years ago

Thank you for your suggestion.

Actually I have think of this initially, but then using -c '<cmds>' makes it extremely troublesome to escape user supplied arguments when it contains single quotes (double quote just need to escape once but for single quote I really don't know how to escape in this situation). The same applies to Mac's invoking command as well (even more troublesome to invoke the Mac's terminal).

Despite that, I will leave this issue open and I will find ways to correctly escape (or at least handle one level of quotes) in the user arguments when I have time.

PS: Out of my expectation, Windows cmd handles these single and doubles quotes really well. :joy:

tomlau10 commented 8 years ago

This issue is indeed easier than I thought... I just convert all quotes to double quotes then escape them correspondingly and problem solved! :tada: