Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/qt/terminal_widget.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Qt terminal geometry follows the current font; semantics stay in the model.
// Qt terminal geometry follows the current font; semantics stay in the model.
#pragma once

#include "terminal_session.hpp"
Expand Down Expand Up @@ -122,10 +122,23 @@ class TerminalWidget final : public QWidget {
}
if (!character_text) bytes = next.finish() + bytes;
if (bytes.empty() || model_.send(bytes)) {
if (!bytes.empty()) input_log(bytes);
keyboard_ = next;
event->accept();
} else event->ignore();
}
// Opt-in observation for the input path: records the exact bytes that
// reached the session so an IME experiment can be checked without guessing.
static void input_log(const std::string& bytes) {
static const char* path = std::getenv("TERMFORGE_QT_INPUT_LOG");
if (path == nullptr) return;
FILE* stream = std::fopen(path, "ab");
if (stream == nullptr) return;
std::fprintf(stream, "{\"bytes\":%d,\"hex\":\"", static_cast<int>(bytes.size()));
for (const char ch : bytes) std::fprintf(stream, "%02x", static_cast<unsigned char>(ch));
std::fprintf(stream, "\"}\n");
std::fclose(stream);
}
// The candidate window needs the caret cell, not the widget origin.
QVariant inputMethodQuery(Qt::InputMethodQuery query) const override {
if (query == Qt::ImCursorRectangle && grid_ready_) {
Expand Down