Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
[Coke]_ let me know if you need me to try something on a windows box, lizmat. 02:56
nine lizmat: if $*IN = open '/dev/tty'; does the trick, then that's cool. I somehow doubt that it does though. I think all that would do is open the tty and assign the handle to the dynamic variable $*IN. But it doesn't change the STDIN file descriptor. 07:36
Well there is actually a chance of $*IN = open '/dev/tty' doing what you need: if the open call uses the lowest unused file descriptor which in your case would be STDIN. 07:38
Otherwise you need to my int $stdin = $*IN.native-handle; $*IN.close; $*IN = open '/dev/tty'; dup2($*IN.native-handle, $stdin); run('vim') 07:40
Though $stdin should always be just 0
lizmat Actually, it turns out that I somehow got the idea that to redirect stderr of a run of raku into the stdin of rak, I should use " 2> >(rak.... _ " syntax in the shell 08:19
I should have used " 2>&1 | rak "
in that case, just doing my $*IN = open '/dev/tty' does the trick in the same scope as the run 'vim' 08:21
github.com/lizmat/Edit-Files/blob/...akumod#L46 08:22