beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
alexshendi has quit [*.net *.split]
alexshendi has joined #picolisp
calle has quit [Ping timeout: 240 seconds]
alexshendi has quit [Ping timeout: 272 seconds]
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 268 seconds]
alexshendi has joined #picolisp
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
tankf33der has quit [Quit: the lounge - https://webirc.envs.net]
tankf33der has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
calle has joined #picolisp
razzy has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
<razzy> hello, line (pipe (call 'sh "-c" "cat ./.pil/pilrc | fzf") (read)) stopped working in pil. is it intentional?
<abu[m]> The combination of call in pipe is not good
<abu[m]> 'pipe' runs Pil code, and call is not useful for output
<abu[m]> Don't you know 'in'?
alexshe72 has joined #picolisp
razzy has quit [Ping timeout: 240 seconds]
razzy has joined #picolisp
<razzy> abu[m]: i think (in ) does not let me create new screen with user input.
<razzy> i need call for that
<beneroth> (pipe (exec ...))
<beneroth> exec doesn't start another new process
<beneroth> I use this to wrap other interactive cli programs
<razzy> beneroth: thank you. will try.
razzy has quit [Client Quit]
<abu[m]> Sorry, phone all the time
<abu[m]> razzy, you are right in that 'call' does some terminal handling
<abu[m]> setpgid, tcsetpgrp etc.
razzy has joined #picolisp
<razzy> well, (pipe (exec ...)) also not working. same problem.
<abu[m]> You said you *need* call
<razzy> i am dropping that branch. :(
<abu[m]> (exec "sh" ...) does not do process groups and terminal handling
<abu[m]> Or you do (in ...) and do your own terminal setup
<abu[m]> Cause 'call' is not meant for output
<razzy> abu[m]: i meant i think i need call :]
<abu[m]> It is for running a program without useful output
<abu[m]> Though it might work, beause 'pipe' connects to the process's stdout, it smells not good
<razzy> i do not see upside of that development.
<abu[m]> Then we must find out *what* does not work, and *why*
<abu[m]> "stopped working in pil" means that it waits in (read) probably
<abu[m]> Try $ strace -p <pid>
<abu[m]> You probably see that it hangs in read()
<razzy> i used the line (pipe (call 'sh "-c" "cat ./.pil/pilrc | fzf")(read)) in previous versions of pil. not it says "Failed to read /dev/tty"
<razzy> *now it says
<abu[m]> You are trying very difficult things. All these processes do something with their stdio and terminal settings
<abu[m]> As beneroth says, (pipe (exec ...)) is good, but it does not change the terminal settings
<abu[m]> You could strace all involved programs like fzf to see what they actually do
<abu[m]> I suppose fzf reopens its tty channels to be interactive, so what happens to the pipe to the parent then?
alexshe72 has quit [Quit: -a- Connection Timed Out]
<abu[m]> It might be simply closed
<razzy> I will do it by hand for now. i have other problems.
<abu[m]> You say it worked before. If it is different now, perhaps it is from the change in @src/io.l in 18may22
<razzy> thx.
<abu[m]> See @doc/ChangeLog: Clear stdin 'tty' flag in 'pipe' child
<beneroth> (pipe (call 'sh "-c" "cat ./.pil/pilrc | fzf")(read)
<beneroth> where is this (read) reading from?
<abu[m]> As it is in 'pipe', it reads from the pipe
<razzy> beneroth: it is reading from call. imho stdout
<beneroth> call is not giving you stdout
<abu[m]> yes, that's what I told razzy
<abu[m]> He abuses 'call' ;)
alexshendi has joined #picolisp
<beneroth> (in '(sh -c "cat ./.pil/pilrc | fzf") (read)) could do
<beneroth> but you start fzf without arguments
<beneroth> that gives an interactive fzf prompt, no?
<abu[m]> right, and the difference is that 'call' does more (see above)
<beneroth> razzy, either you are using fzf wrong (you need it to give arguments) or you want to wrap the interactive fzf session?
<beneroth> the second thing I would do with (pipe (exec ...) ...), but its tricky insofar as your wrapping code must always fit the state of the interactive program.
<abu[m]> Or use temporary files instead ef a pipe
<razzy> beneroth: i want to wrap interactive session. yes. it was working before.
<beneroth> additionally it might be possible that fzf detects when its running in a script instead of a interactive session (lack of tty). that can be circumvented by wrapping the call to fzf into script, but tricky again
<beneroth> razzy, try to do what you want to do without picolisp first, just with shell
<beneroth> ah
<beneroth> you're using picolisp in a script or just in the repl?
<razzy> repl
<beneroth> yeah, then call looks like it works, because it will bind to your repl
calle has quit [Ping timeout: 260 seconds]
<beneroth> so I guess (call 'sh '-c "cat ./.pil/pilrc | fzf") used to work?
<beneroth> what error do you get if you do that now?
<razzy> i do not want to waste collective time. i will look at changelog.
<beneroth> ok
<abu[m]> First try only 'call', without a pipe
<beneroth> for only using it in repl, (call) is okay
<razzy> beneroth: Failed to read /dev/tty
<beneroth> razzy, yeah so fzf detects that it has no tty
<beneroth> which is correct
<abu[m]> razzy, I think this is not due to the above change in 'tty' flag
<beneroth> T
<beneroth> it's probably a change in fzf and not pil
<abu[m]> yes, might well be
<beneroth> I have to go now, will write some more later
beneroth has quit [Quit: Leaving]
<abu[m]> beneroth: Right, it has no TTY
<abu[m]> CU ☺
<razzy> chmm.
razzy has quit [Quit: leaving]
<abu[m]> Can fzf not communicate via some other channel? Like a socket? Stdio is over-used here.
alexshe91 has joined #picolisp
alexshendi has quit [Ping timeout: 272 seconds]
calle has joined #picolisp
alexshe91 has quit [Quit: -a- Connection Timed Out]
calle has quit [Ping timeout: 268 seconds]
alexshendi has joined #picolisp
calle has joined #picolisp
calle has quit [Ping timeout: 255 seconds]
alexshendi has quit [Ping timeout: 272 seconds]
alexshendi has joined #picolisp
alexshe66 has joined #picolisp
alexshendi has quit [Ping timeout: 272 seconds]
alexshendi has joined #picolisp
alexshe66 has quit [Ping timeout: 264 seconds]
alexshe92 has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
calle has joined #picolisp
alexshe92 has quit [Read error: Connection reset by peer]
alexshe41 has joined #picolisp
alexshe41 has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 272 seconds]
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 272 seconds]
alexshendi has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
alexshendi has joined #picolisp
calle has quit [Ping timeout: 268 seconds]