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

Cursor misalignment occurs in Windows LocalShell #39

Closed
QQxiaoming opened this issue Jun 5, 2024 · 2 comments
Closed

Cursor misalignment occurs in Windows LocalShell #39

QQxiaoming opened this issue Jun 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@QQxiaoming
Copy link
Owner

QQxiaoming commented Jun 5, 2024

Adjusting the window size of the local terminal in Windows will cause the cursor position to be incorrect.

  • OS: Windows11
  • Version: msvc version

This issue may come from the reflow of the conpty,

refer to the following:
microsoft/terminal#16985
microsoft/terminal#14291
microsoft/terminal#1173

QuardCRT currently does not plan to support conpty‘s resize quirk. Waiting for the official support of passthrough may fundamentally solve this problem.

@QQxiaoming QQxiaoming added the bug Something isn't working label Jun 5, 2024
QQxiaoming added a commit that referenced this issue Jun 6, 2024
@QQxiaoming
Copy link
Owner Author

Now we can solve this problem by setting ResizeQuirk to false, but we need to check whether it will introduce other problems.

// FIXME: QuardCRT is not support resizeQuirk
const BOOL bResizeQuirk = false; //(dwFlags & PSEUDOCONSOLE_RESIZE_QUIRK) == PSEUDOCONSOLE_RESIZE_QUIRK;
const BOOL bWin32InputMode = (dwFlags & PSEUDOCONSOLE_WIN32_INPUT_MODE) == PSEUDOCONSOLE_WIN32_INPUT_MODE;
swprintf_s(cmd,
MAX_PATH,
pwszFormat,
_ConsoleHostPath(),
bInheritCursor ? L"--inheritcursor " : L"",
bWin32InputMode ? L"--win32input " : L"",
bResizeQuirk ? L"--resizeQuirk " : L"",
size.X,
size.Y,
signalPipeConhostSide.get(),
serverHandle.get());

@QQxiaoming
Copy link
Owner Author

After some testing, removing the "--resizeQuirk" setting has better display effects on PowerShell, SSH, and WSL than before. Although there are still some strange behaviors, they are completely consistent with the behavior of Microsoft Terminal, so this change is acceptable. We continue to look forward to further optimization of conpty by Microsoft in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant