#358 Bug?: fansh doesn't like SIGSUSP

f00biebletch Thu 4 Sep 2008

Sorry to keep pecking at your poor shell, but fansh does not handle SIGSUSP (ctrl-z) at all. I only bring it up because the other big REPLs I use (python, irb, erl, gsi) all handle it nicely:

snark:fan kevin$ fansh
Fan Shell v1.0.31 ('?' for help)
fansh> ^Z
[3]+  Stopped                 fansh
snark:fan kevin$ fg %3
fansh
sys::IOErr: java.io.IOException: Interrupted system call
java.io.FileInputStream.readBytes (FileInputStream.java)
java.io.FileInputStream.read (FileInputStream.java:194)
java.io.BufferedInputStream.fill (BufferedInputStream.java:218)
java.io.BufferedInputStream.read (BufferedInputStream.java:235)
fan.sys.SysInStream.r (SysInStream.java:51)
fan.sys.Charset$Utf8Decoder.decode (Charset.java:119)
fan.sys.InStream.rChar (InStream.java:84)
fan.sys.InStream.readLine (InStream.java:373)
fan.sys.InStream.readLine (InStream.java:365)
fansh::Shell.run (Shell.fan:32)
fansh::Main.main (Shell.fan:167)
sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java)
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke (Method.java:585)
fan.sys.Method.invoke (Method.java:515)
fan.sys.Method$MethodFunc.call (Method.java:216)
fan.sys.Method.call (Method.java:178)
fanx.tools.Fan.callMain (Fan.java:132)
fanx.tools.Fan.executeType (Fan.java:99)
fanx.tools.Fan.execute (Fan.java:40)
More...
snark:fan kevin$ 

brian Thu 4 Sep 2008

I don't think we can trap signals in Java without resorting to sun APIs.

What happens if you just suppress IOExceptions on readLine?

katox Thu 4 Sep 2008

f00biebletch: irb handles it well, jirb however behaves exactly like fansh

cgrinds Thu 4 Sep 2008

f00biebletch what platform are you on?

I believe this can be made to work with jline which is what I used for fansh to support completion and cmd line editing.

f00biebletch Thu 4 Sep 2008

I'm OSX, would expect same behavior on linux etc. It is certainly a java issue, not sure how important it is, especially if I break the ctrl-d habit.

I think you're right about jline, but, again, doubt it's worth the trouble.

Login or Signup to reply.