diff --git a/src/vtbackend/Functions.h b/src/vtbackend/Functions.h index 578b97a2a0..563a8f523b 100644 --- a/src/vtbackend/Functions.h +++ b/src/vtbackend/Functions.h @@ -383,7 +383,8 @@ constexpr inline auto CHA = detail::CSI(std::nullopt, 0, 1, std::nullopt constexpr inline auto CHT = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'I', VTType::VT100, "CHT", "Cursor Horizontal Forward Tabulation"); constexpr inline auto CNL = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'E', VTType::VT100, "CNL", "Move cursor to next line"); constexpr inline auto CPL = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'F', VTType::VT100, "CPL", "Move cursor to previous line"); -constexpr inline auto CPR = detail::CSI(std::nullopt, 1, 1, std::nullopt, 'n', VTType::VT100, "CPR", "Request Cursor position"); +constexpr inline auto ANSIDSR = detail::CSI(std::nullopt, 1, 1, std::nullopt, 'n', VTType::VT100, "DSR", "Device Status Report (ANSI)"); +constexpr inline auto DSR = detail::CSI('?', 1, 1, std::nullopt, 'n', VTType::VT100, "DSR", "Device Status Report (DEC)"); constexpr inline auto CUB = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'D', VTType::VT100, "CUB", "Move cursor backward"); constexpr inline auto CUD = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'B', VTType::VT100, "CUD", "Move cursor down"); constexpr inline auto CUF = detail::CSI(std::nullopt, 0, 1, std::nullopt, 'C', VTType::VT100, "CUF", "Move cursor forward"); @@ -538,7 +539,6 @@ constexpr static auto allFunctionsArray() noexcept CHT, CNL, CPL, - CPR, CUB, CUD, CUF, @@ -558,6 +558,8 @@ constexpr static auto allFunctionsArray() noexcept DECSED, DECSERA, DECSEL, + ANSIDSR, + DSR, XTRESTORE, XTSAVE, DECPS, diff --git a/src/vtbackend/Screen.cpp b/src/vtbackend/Screen.cpp index e71b5fc373..689e17ea47 100644 --- a/src/vtbackend/Screen.cpp +++ b/src/vtbackend/Screen.cpp @@ -2785,7 +2785,7 @@ namespace impl } template - ApplyResult CPR(Sequence const& seq, Screen& screen) + ApplyResult ANSIDSR(Sequence const& seq, Screen& screen) { switch (seq.param(0)) { @@ -2795,6 +2795,15 @@ namespace impl } } + template + ApplyResult DSR(Sequence const& seq, Screen& screen) + { + switch (seq.param(0)) + { + default: return ApplyResult::Unsupported; + } + } + template ApplyResult DECRQPSR(Sequence const& seq, Screen& screen) { @@ -3450,7 +3459,8 @@ ApplyResult Screen::apply(FunctionDefinition const& function, Sequence con case CPL: moveCursorToPrevLine(LineCount::cast_from(seq.param_or(0, Sequence::Parameter { 1 }))); break; - case CPR: return impl::CPR(seq, *this); + case ANSIDSR: return impl::ANSIDSR(seq, *this); + case DSR: return impl::DSR(seq, *this); case CUB: moveCursorBackward(seq.param_or(0, ColumnCount { 1 })); break; case CUD: moveCursorDown(seq.param_or(0, LineCount { 1 })); break; case CUF: moveCursorForward(seq.param_or(0, ColumnCount { 1 })); break;