Open dangooddd opened 2 days ago
Code is almost identical to menu example from repo
#include "embf/directory.hpp"
#include "ftxui/component/component.hpp"
#include "ftxui/component/component_options.hpp"
#include "ftxui/component/screen_interactive.hpp"
#include "ftxui/dom/elements.hpp"
#include "ftxui/screen/screen.hpp"
#include <ftxui/dom/elements.hpp>
#include <iostream>
int main(int argc, char *argv[]) {
using namespace ftxui;
auto screen = ScreenInteractive::TerminalOutput();
std::vector<std::string> entries = {
"entry 1",
"entry 2",
"entry 3",
};
int selected = 0;
MenuOption option;
option.on_enter = screen.ExitLoopClosure();
auto menu = Menu(&entries, &selected, option) | borderLight;
screen.Loop(menu);
std::cout << "Selected element = " << selected << std::endl;
return 0;
}
Hello, Line wrapping are implemented by the terminal emulator. I don't think I know any solution against this.
If you used ScreenInteractive::Fullscreen
we would draw over the whole area, on an alternate screen, which would avoid seeing all the garbage.
If you know about any other solution, I would happily implement it.
I see that fzf does this, but only when resize left/right. I guess that after sigwinch it redraws window at top of terminal, so it becomes fullscreen-like. See video below.
I think that is not a bad solution, because anyway output of terminal becomes crap, so why not to clear it? What do you think about this?
clearing the terminal during a screen width change looks like a good idea! Do you want to try submitting a PR?
I think I can try, will open draft PR soon!
Hi! I got problem with terminal resizing and ScreenInteractive::TerminalOutput component. This issue appears not only in tmux, but also in plain terminal (tested on Kitty, Alacritty, Foot and Konsole). Redrawing works well when fullscreen.
How can I solve this? Compiled with clang 19, version of ftxui is 5.0.0
I am new to the TUI thing and this community, so sorry if this issue well known, I can't find anything about this.
redrawing_issue.webm