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

read: bad option: -1 #54

Closed DariushMazlumi closed 5 months ago

DariushMazlumi commented 4 years ago

Hi I have been using this package for about 6 months now, I love it and very used to it. recently, due to some reasons, I decided to wipe my mac completely and upgrade from Mojave 10.14 to Catalina 10.15. so after that, I installed my stuff including atom and my packages; but unfortunately, I'm getting a "read: bad option: -1 " after the program's output (though it successfully compiles and runs my file):

Screen Shot 1398-10-06 at 00 07 39

and as I remember, it used to print "Press any key to continue...", which it doesn't now. I also tried disabling other packages and restarting the atom; which didn't solve the issue. by the way, this information might help:

Atom: 1.42.0 x64 Electron: 4.2.7 OS: Mac OS X 10.15.2

Non-Core Packages

atom-smart-template 0.3.2 
autosave-onchange 1.5.1 
gcc-make-run 0.2.12 
gpp-compiler 3.0.7 
linter-gcc 0.7.1 
kessyus commented 4 years ago

I've the same problem here. Did you find how to solve it?

DariushMazlumi commented 4 years ago

@kessyus hi. unfortunately no; I didn't. and it seems no one is responding to this issue. actually, due to some other compatibility problems, I decided to try windows. since then, everything is working fine.

kessyus commented 4 years ago

Yeah, I decided to go with VSCode even though I’m a huge fan of Atom... 😢

dmsleptsov commented 3 years ago

HI guys,

On the man page describes the parameters and -n nchars should be with space. But in source code following line

when 'linux' then info.cmd = "#{terminal} \"" + @escdq("\"#{mk}\" -sf \"#{info.base}\" run") + "; read -n1 -p 'Press any key to continue...'\""

But I am not sure, In my system man read as read system call. Also using -p flag return not an identifier: -p, but read-blocking work as expected

NojusGl commented 2 years ago

If someone faces it today: looks like the script was written for the Bash shell. Bash was default before macOS Catalina.

So, problem can be fixed by using the Bash shell (by default): https://support.apple.com/en-gb/HT208050 (I believe there are more elegant solutions than that).

tomlau10 commented 5 months ago

it's a bit late, but should be fixed in #61