@alex.sheluchin has joined the channel
Hi @smith.adriane, I'm wondering if it's possible to use this to display an interactive https://github.com/junegunn/fzf picker. I have more in mind for my end goal (wrapping some input elements around it for controls), but to start I just want to know if I can embed an interactive CLI program in a membrane-term layout.
probably, but it's probably a pain to get the selection/data out
I haven't tried fzf specifically, but I've tried several complex terminal applications like emacs/vim and don't know of any issues.
Do you happen to have any of those experiments public somewhere or could you suggest how to accomplish it from a high level?
https://github.com/phronmophobic/easel/blob/main/src/com/phronemophobic/easel/term.clj This is code for the terminal in easel which I use everyday. I've been doing most of my development using emacs running in this terminal.
but fwiw, I don't really recommend the approach of using terminal UIs when you could just build a regular UI
There's a file selector example in the membrane repo: https://github.com/phronmophobic/membrane/blob/master/src/membrane/example/file_selector.clj
> but fwiw, I don't really recommend the approach of using terminal UIs when you could just build a regular UI I basically want to add some ability to provide more inputs to fzf to extend my https://github.com/sheluchin/phuzql experiment. Do you mean that membrane-term wouldn't be a good fit for this?
membrane-term is for including a terminal emulator ui component in an application
It doesn't really help if you want to make a terminal application that runs in a regular terminal
Are you trying to build an application with 2d graphics or a command line application that runs in a terminal?
Hmm, how would you classify fzf itself? I think that falls more within the first category.
fzf provides me with a single text input and a picker. I need to keep all that while adding some controls for pagination and additional parameters.
afaict, fzf is a command line application that runs in terminal
TBH it's not totally clear to me what the distinction is. After it's initially invoked from the CLI it draws out some shapes and provides interactivity.
> fzf provides me with a single text input and a picker. I need to keep all that while adding some controls for pagination and additional parameters. I don't know how to do that. As far as I know, there are no reusable pieces, constructs, or otherwise that would make that approach worth the effort.
> TBH it's not totally clear to me what the distinction is. After it's initially invoked from the CLI it draws out some shapes and provides interactivity. The terminal essentially divides up space into rectangles corresponding to some monospaced font. You draw "graphics" by setting these rectangles to a characters in that monospaced font using ansi codes or something like it. An application with 2d graphics usually let's you draw any shapes, text, and images that you want with fewer limitations.
Terminal applications are usually a bit easier to use over the network, but they're quite limited compared to regular applications.
Thanks for helping me understand the difference, that definitely adds some clarity.
I think it could work as a CLI app if fzf can be extended to support additional inputs. It might be possible through --bind, but you could be right that it's not worth the effort. I'll take a look at the easel code to see if there's something I can use in there, or if I need a totally different approach.