Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not emit control characters in title reports #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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/ConEmuCD/ConAnsiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ bool SrvAnsiImpl::ReportString(LPCWSTR asRet)
LPCWSTR pc = asRet;
for (int i = 0; i < nLen; i++, p++, pc++)
{
const char ch = (wcschr(UNSAFE_CONSOLE_REPORT_CHARS, *pc) == nullptr) ? *pc : L' ';
const char ch = *pc >= 0x20 ? *pc : L' ';
p->EventType = KEY_EVENT;
p->Event.KeyEvent.bKeyDown = TRUE;
p->Event.KeyEvent.wRepeatCount = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/ConEmuHk/Ansi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,7 @@ BOOL CEAnsi::ReportString(LPCWSTR asRet)
LPCWSTR pc = asRet;
for (size_t i = 0; i < nLen; i++, p++, pc++)
{
const char ch = (wcschr(UNSAFE_CONSOLE_REPORT_CHARS, *pc) == nullptr) ? *pc : L' ';
const char ch = *pc >= 0x20 ? *pc : L' ';
p->EventType = KEY_EVENT;
p->Event.KeyEvent.bKeyDown = TRUE;
p->Event.KeyEvent.wRepeatCount = 1;
Expand Down
3 changes: 0 additions & 3 deletions src/common/WConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DISABLE_NEWLINE_AUTO_RETURN 0x0008
#endif

// These keys should not be reported back to console input
#define UNSAFE_CONSOLE_REPORT_CHARS L"\r\n\t"

struct MY_CONSOLE_SCREEN_BUFFER_INFOEX
{
ULONG cbSize;
Expand Down