Skip to content

Commit

Permalink
Remove the workaround for WT-17833
Browse files Browse the repository at this point in the history
The bug existed only in Preview and only from 1.22.2362.0 (2024/08/27) till 1.22.2702.0 (2024/09/28), so it should be safe to do so
  • Loading branch information
alabuzhev committed Feb 4, 2025
1 parent 49b87e2 commit f0be4e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
6 changes: 6 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
--------------------------------------------------------------------------------
drkns 2025-02-04 20:18:36+00:00 - build 6430

1. Remove the workaround for WT-17833.
The bug existed only in Preview and only from 1.22.2362.0 (2024/08/27) till 1.22.2702.0 (2024/09/28), so it should be safe to do so.

--------------------------------------------------------------------------------
drkns 2025-02-03 18:07:40+00:00 - build 6429

Expand Down
30 changes: 0 additions & 30 deletions far/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,31 +559,6 @@ namespace console_detail
std::optional<DWORD> m_ConsoleMode;
};

class scoped_vt_input
{
public:
NONCOPYABLE(scoped_vt_input);

scoped_vt_input():
m_ConsoleMode(::console.UpdateMode(::console.GetInputHandle(), ENABLE_VIRTUAL_TERMINAL_INPUT, ENABLE_LINE_INPUT))
{
}

~scoped_vt_input()
{
if (m_ConsoleMode)
::console.SetMode(::console.GetInputHandle(), *m_ConsoleMode);
}

explicit operator bool() const
{
return m_ConsoleMode.has_value();
}

private:
std::optional<DWORD> m_ConsoleMode;
};

static string query_vt(string_view const Command)
{
// A VT query works as follows:
Expand Down Expand Up @@ -615,13 +590,8 @@ namespace console_detail
// Fortunately, it seems that user input is queued before and/or after the responses,
// but does not interlace with them.

// We also need to enable VT input, otherwise it will only work in a real console.
// Are you not entertained?

scoped_vt_input const VtInput;
if (!VtInput)
throw far_exception(L"scoped_vt_input"sv);

const auto Dummy = CSI L"0c"sv;

if (!::console.Write(concat(Dummy, Command, Dummy)))
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6429
6430

0 comments on commit f0be4e3

Please sign in to comment.