Skip to content
Open
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
8 changes: 8 additions & 0 deletions app/src/main/cpp/console/commands/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ void ConsoleCommand::console_attach(
warned = true;
}
} else {
// The tty line discipline still has ICRNL set (we only touch
// c_lflag above), so the Enter key arrives here as LF. Windows
// SAC accepts LF, but the CMD channel's console only treats CR
// as Enter, so map LF back to CR before it reaches the guest.
// Linux getty is unaffected: its ICRNL turns CR back into NL.
// Same fix as cloud-hypervisor#1770 / PR #1771.
for (ssize_t i = 0; i < n; i++)
if (buf[i] == '\n') buf[i] = '\r';
Json::Value write_req;
write_req["command"] = "vm_console_write";
write_req["vm_id"] = filter_vm;
Expand Down
Loading