Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/linyaps_box/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ void configure_terminal(const linyaps_box::container &container,
}

if (process.console_size) {
slave.set_size({ process.console_size->height, process.console_size->height, 0, 0 });
slave.set_size({ process.console_size->height, process.console_size->width, 0, 0 });
}

auto root = linyaps_box::utils::open("/", O_PATH | O_CLOEXEC | O_DIRECTORY);
Expand Down
2 changes: 1 addition & 1 deletion src/linyaps_box/io/forwarder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ auto Forwarder::set_src(const utils::file_descriptor &src) -> void
auto Forwarder::set_dst(const utils::file_descriptor &dst) -> void
{
dst_.fd = &dst;
const auto ev = EPOLLET;
const uint32_t ev = EPOLLET;

dst_.pollable = poller.get().add(*dst_.fd, ev);
dst_.last_events = dst_.pollable ? ev : 0;
Expand Down
4 changes: 2 additions & 2 deletions src/linyaps_box/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ auto terminal_master::resize(struct winsize size) -> void
}

terminal_slave::terminal_slave(terminal_slave &&other) noexcept
: termios(std::exchange(other.termios, std::nullopt))
, slave_(std::move(other.slave_))
: slave_(std::move(other.slave_))
, termios(std::exchange(other.termios, std::nullopt))
{
}

Expand Down
31 changes: 31 additions & 0 deletions tests/ll-box-st/14-console-size.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "Change terminal size",
"process": {
"user": {
"uid": 0,
"gid": 0
},
"args": ["stty", "size"],
"env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM=xterm",
"HOME=/root"
],
"cwd": "/",
"terminal": true,
"consoleSize": {
"height": 24,
"width": 80
}
},
"linux": {
"readonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sysrq-trigger"
]
},
"expected": "24 80"
}
3 changes: 2 additions & 1 deletion tests/ll-box-st/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ set(linyaps-box_SMOKE_TESTS
./10-check-oom.json
./11-output-to-null.json
./12-bind-host-dev.json
./13-pid-extension.json)
./13-pid-extension.json
./14-console-size.json)

foreach(test ${linyaps-box_SMOKE_TESTS})
add_test(
Expand Down
2 changes: 1 addition & 1 deletion tests/ll-box-st/ll-box-st
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function run_test() {
log "[INFO] ==== COMMAND OUTPUT START ===="
local REAL
REAL="$(
LINYAPS_BOX_LOG_FORCE_STDERR=1 "${TEST_COMMAND[@]}" </dev/null | tr -d '\r' && :
LINYAPS_BOX_LOG_LEVEL=6 LINYAPS_BOX_LOG_FORCE_STDERR=1 "${TEST_COMMAND[@]}" </dev/null | tr -d '\r' && :
)" && :
EXIT_CODE=$?
log "[INFO] ==== COMMAND OUTPUT END ======"
Expand Down