Skip to content

Commit

Permalink
[vtbackend] Fix function definition DSR
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Parpart <[email protected]>
  • Loading branch information
christianparpart committed Oct 10, 2023
1 parent 294c44a commit 19d6fac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/vtbackend/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -538,7 +539,6 @@ constexpr static auto allFunctionsArray() noexcept
CHT,
CNL,
CPL,
CPR,
CUB,
CUD,
CUF,
Expand All @@ -558,6 +558,8 @@ constexpr static auto allFunctionsArray() noexcept
DECSED,
DECSERA,
DECSEL,
ANSIDSR,
DSR,
XTRESTORE,
XTSAVE,
DECPS,
Expand Down
14 changes: 12 additions & 2 deletions src/vtbackend/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2785,7 +2785,7 @@ namespace impl
}

template <typename Cell>
ApplyResult CPR(Sequence const& seq, Screen<Cell>& screen)
ApplyResult ANSIDSR(Sequence const& seq, Screen<Cell>& screen)
{
switch (seq.param(0))
{
Expand All @@ -2795,6 +2795,15 @@ namespace impl
}
}

template <typename Cell>
ApplyResult DSR(Sequence const& seq, Screen<Cell>& screen)
{
switch (seq.param(0))
{
default: return ApplyResult::Unsupported;
}
}

template <typename Cell>
ApplyResult DECRQPSR(Sequence const& seq, Screen<Cell>& screen)
{
Expand Down Expand Up @@ -3450,7 +3459,8 @@ ApplyResult Screen<Cell>::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<ColumnCount>(0, ColumnCount { 1 })); break;
case CUD: moveCursorDown(seq.param_or<LineCount>(0, LineCount { 1 })); break;
case CUF: moveCursorForward(seq.param_or<ColumnCount>(0, ColumnCount { 1 })); break;
Expand Down

0 comments on commit 19d6fac

Please sign in to comment.