While working with Crysterm, I found that shards run and crystal run handle terminal input differently. For crysterm, while using shards run, the application would run, but no keyboard input would be registered. With Crystal's 2048 example, shards run would fail with the following error code:
Error running at_exit handler: tcgetattr: Inappropriate ioctl for device
Unhandled exception: tcgetattr: Inappropriate ioctl for device (IO::Error)
from /usr/lib/crystal/crystal/system/unix/file_descriptor.cr:229:5 in 'read_keypress'
from src/experiments.cr:222:5 in 'read_action'
from src/experiments.cr:198:25 in 'run'
from src/experiments.cr:384:1 in '__crystal_main'
from /usr/lib/crystal/crystal/main.cr:115:5 in 'main_user_code'
from /usr/lib/crystal/crystal/main.cr:101:7 in 'main'
from /usr/lib/crystal/crystal/main.cr:127:3 in 'main'
from /usr/lib/libc.so.6 in '??'
from /usr/lib/libc.so.6 in '__libc_start_main'
from /home/exarch/Documents/projects-crystal/experiments/bin/experiments in '_start'
from ???
I don't know why this behavior is happening. It does not happen when using crystal run
While working with Crysterm, I found that
shards run
andcrystal run
handle terminal input differently. For crysterm, while usingshards run
, the application would run, but no keyboard input would be registered. With Crystal's 2048 example,shards run
would fail with the following error code:I don't know why this behavior is happening. It does not happen when using
crystal run