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.
lizmat jnthn nine what am I doing wrong getting STDIN reconnected? 13:14
gist.github.com/lizmat/05fbd921cab...ad14d08928
and yes, I intend to put a functional result into a module :-) 13:15
nine lizmat: so you're closing STDIN, but then immediately opening it again and connecting it again to the tty. The result is the same as if you had just done nothing 14:00
s/again to the tty/again to the input file/ 14:02
You want to dup $*IN, then close it, connect $*IN to the tty device, run vim, close $*IN and dup2 $*IN from where you saved the original descriptor 14:04
Also there's no need for EVAL. github.com/niner/Inline-Perl5/blob...er.pm6#L15 14:06
lizmat thanks for the non-EVAL tip 16:51
nine: fwiw, I'm not interested in the part when returning from vim 16:52
lizmat so essentially, you're saying: $*IN.close; $*IN = open '/dev/tty'; 16:59
actually: $*IN.close; $*IN = open '/dev/tty'; run 'vim' 17:00