-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
A number of c++ printing function outputs are not capture by xw::output. In fact it seems that only std::cout+std::flush (<< std::endl is equivalent to << '\n' << std::flush) is captured.
The issue may come from xeus or xeus-cpp itself.
For std::cout I believe we must force a std::flush (otherwise that is most surprising to the user).
Here is a reproducer.
Cell 1
#include <iostream>
#include <print>
#include <xcpp/xdisplay.hpp>
#include <xwidgets/xall.hpp>Cell 2
auto out = xw::output();
xcpp::display(out);Cell 3
{
auto g = out.guard();
xcpp::clear_output();
std::cout << "Cout flushed\n" << std::flush;
std::cout << "Cout not flushed\n";
std::print("Print\n");
std::println("Println");
std::puts("Puts");
std::printf("Printf\n");
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
