Skip to content

Cursor attributes cannot be set with ANSI VT Sequences before any user input #16749

Open
@rforzachamp821

Description

Windows Terminal version

1.20.10303.0

Windows build number

10.0.22631.0

Other Software

N/A (the code in the repro steps should create the effect)

Steps to reproduce

  1. Compile something along the lines of the following C++ code:
#include <iostream>
int main() {
	std::cout << "\033[2 q";
	std::cin.get();
	std::cout << "\033[2 q";
	std::cin.ignore(99999999, '\n'); // you can use INT_MAX in place of the spammed 9s
        std::cin.get();

	return 0;
}

This code sets the new cursor attributes, waits for an ENTER key, sets the new cursor attributes again, and waits for an enter key again.

  1. Run it by clicking on the generated executable, NOT from the VS debug console (if using VS)
  2. The first time the program requests an ENTER key, there should be the default cursor attributes. Once the ENTER key is pressed, only then should the cursor attributes set.
2024-02-22_20-01-49.mp4

Expected Behavior

Cursor attributes should have been set on command before any user input.

Actual Behavior

Cursor attribute setting was ignored, until user inputted an ENTER character. Only then could any of the necessary cursor attribute VT sequences work (e.g "\033[2 q").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Area-VTVirtual Terminal sequence supportIssue-BugIt either shouldn't be doing this or needs an investigation.Priority-3A description (P3)Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions