walez has quit [Read error: Connection reset by peer]
walez has joined #crystal-lang
Starfoxxes has quit [Ping timeout: 240 seconds]
Starfoxxes has joined #crystal-lang
wowi42 has joined #crystal-lang
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 246 seconds]
taupiqueur has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
hightower2 has quit [Read error: Connection reset by peer]
taupiqueur has joined #crystal-lang
walez has quit [Quit: Leaving]
jmdaemon has quit [Ping timeout: 240 seconds]
Sankalp has quit [Ping timeout: 272 seconds]
Sankalp has joined #crystal-lang
<FromGitter>
<noaheverett> Having a interesting issue with running a command with Process.new (or .run) and interacting with it via the input/output pipe (either passed or provided by .run |proc|)
<FromGitter>
<noaheverett> If I run say "bash" and send in "pwd" via input and read the response via output, works great
<FromGitter>
<noaheverett> but I have a specific "daemon" i'm running that generates output and also takes input that it's not taking any input (or at least not visibly responding)
<FromGitter>
<noaheverett> if I set the input pipe to STDIN, it responds to my keyboard input
<FromGitter>
<noaheverett> but if I set it to a custom pipe (i.e. reader,writer = IO.pipe) it doesn't seem to respond
<FromGitter>
<noaheverett> is it possible the command I'm running is just not working correctly with a non-STDIN pipe or any way to debug this in Crystal I may not be thinking of? Tried variations of spawn loops, trying Process.new/Process.run and running with shell and without
<FromGitter>
<Blacksmoke16> what happens if you do `input: :inherit`?
<FromGitter>
<noaheverett> @Blacksmoke16 gives error if I try to manually write to proc.input `Unhandled exception: Process#input cannot be nil (NilAssertionError)` but if I remove the manual input command it works with my keyboard input like I had set it to STDIN
<FromGitter>
<Blacksmoke16> try `input: :pipe` then
<FromGitter>
<noaheverett> @Blacksmoke16 in that case, it acts like the first code example and doesn't respond
<FromGitter>
<noaheverett> thank you for your help btw, this is day two on debugging this ðĪŠ beginning to think maybe the `chs` command just isn't responding correctly to a non STDIN pipe but not for sure
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<noaheverett> One other thought, the `chs` command is booting a VM and presenting the Linux login screen console, maybe the input isn't triggering the console "return" key like STDIN keyboard input? I've tried puts (which sends a newline) print with variations of \r or \n
<FromGitter>
<Blacksmoke16> there any flags you need to pass to force it to use input IO when it sees its not a tty?
<FromGitter>
<noaheverett> I'll check into that, I appreciate your help!
hightower2 has quit [Remote host closed the connection]
taupiqueur has quit [Ping timeout: 244 seconds]
taupiqueur has joined #crystal-lang
FromGitter has quit [Ping timeout: 260 seconds]
FromGitter has joined #crystal-lang
hellstabber has joined #crystal-lang
_ht has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
walez has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
hellstabber has quit [Quit: Connection closed for inactivity]