Running hashcat with a long commandline messes up the text layout at the prompt #19819

Closed
opened 2026-01-31 06:54:26 +00:00 by claunia · 5 comments
Owner

Originally created by @oldshensheep on GitHub (May 5, 2023).

Windows Terminal version

1.17.1023

Windows build number

10.0.22624.0

Other Software

No response

Steps to reproduce

  1. download hashcat
  2. run this in pwsh: .\hashcat.exe -O -a 3 -m 17210 --increment '$pkzip2$1*1*2*0*c1*114*d9f6f87e*0*28*8*c1*d9f6*840b*74af528f6fe4a979a02f4e51129c298ecf6834e8abdae83ee2beb3a75888c9c987e1e820ec82a246d8061195f2472133f17f3f7f79b37b63ee44f84dea76f6313bbd411d397a3def8927c1ae9b76f9525130a09cc7225616207e042a2cc8752067d147071d7c0d612b0d7a840efd71ecb9ace08ed6cee446163ceb0cbe3f45c295db568a47f32235f1b8fffbb2f7ca4decc69b186a8c654b20de6dfa0fbc0ba4ceb17019f1144846c85195787aa3159697cd4814391fd0db08d10337a77836cc69*$/pkzip2$'
  3. Ctrl+C
  4. up/down arrows will leave corrupted text

https://user-images.githubusercontent.com/29306733/236421620-84c775e5-92fb-4b53-a736-fd282e57b74c.mp4

Expected Behavior

Text should not mess up.

I use vscode to open terminal, and it has no such problem.

Actual Behavior

Text fly to somewhere……
See the video above.

Originally created by @oldshensheep on GitHub (May 5, 2023). ### Windows Terminal version 1.17.1023 ### Windows build number 10.0.22624.0 ### Other Software _No response_ ### Steps to reproduce 1. download hashcat 2. run this in pwsh: `.\hashcat.exe -O -a 3 -m 17210 --increment '$pkzip2$1*1*2*0*c1*114*d9f6f87e*0*28*8*c1*d9f6*840b*74af528f6fe4a979a02f4e51129c298ecf6834e8abdae83ee2beb3a75888c9c987e1e820ec82a246d8061195f2472133f17f3f7f79b37b63ee44f84dea76f6313bbd411d397a3def8927c1ae9b76f9525130a09cc7225616207e042a2cc8752067d147071d7c0d612b0d7a840efd71ecb9ace08ed6cee446163ceb0cbe3f45c295db568a47f32235f1b8fffbb2f7ca4decc69b186a8c654b20de6dfa0fbc0ba4ceb17019f1144846c85195787aa3159697cd4814391fd0db08d10337a77836cc69*$/pkzip2$'` 3. Ctrl+C 4. up/down arrows will leave corrupted text https://user-images.githubusercontent.com/29306733/236421620-84c775e5-92fb-4b53-a736-fd282e57b74c.mp4 ### Expected Behavior Text should not mess up. I use vscode to open terminal, and it has no such problem. ### Actual Behavior Text fly to somewhere…… See the video above.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:54:26 +00:00
Author
Owner

@o-sdn-o commented on GitHub (May 5, 2023):

I see strange things for me in your video. For some unknown reason, after pressing the Up button, the cursor is at the beginning of the command text, and not at the end, as usual

image
image

@o-sdn-o commented on GitHub (May 5, 2023): I see strange things for me in your video. For some unknown reason, after pressing the Up button, the cursor is at the beginning of the command text, and not at the end, as usual ![image](https://user-images.githubusercontent.com/11535558/236522553-5ac8c005-8c79-48e3-b367-90c7e67b6034.png) ![image](https://user-images.githubusercontent.com/11535558/236523104-c1c2abd7-484f-4d91-8b2b-dfe5b773d13e.png)
Author
Owner

@lhecker commented on GitHub (May 5, 2023):

I was able to reproduce the issue. I've updated your description with a way I found to consistently reproduce the issue.

@lhecker commented on GitHub (May 5, 2023): I was able to reproduce the issue. I've updated your description with a way I found to consistently reproduce the issue.
Author
Owner

@j4james commented on GitHub (May 6, 2023):

I think this is probably just a variation of #5094.

It looks like hashcat attempts to setup the window size on startup. See the call to setup_console, which calls SetConsoleWindowSize, which ultimately calls SetConsoleScreenBufferSize. Since conhost doesn't forward those buffer size changes to conpty, the two sides will likely end up out of sync, so it's inevitable the layout will break.

@j4james commented on GitHub (May 6, 2023): I think this is probably just a variation of #5094. It looks like hashcat attempts to setup the window size on startup. See the [call to setup_console](https://github.com/hashcat/hashcat/blob/56b322cf6e68a7d664f489e2a1e05cc0be748ed5/src/main.c#L1217), which [calls SetConsoleWindowSize](https://github.com/hashcat/hashcat/blob/56b322cf6e68a7d664f489e2a1e05cc0be748ed5/src/terminal.c#L131), which ultimately [calls SetConsoleScreenBufferSize](https://github.com/hashcat/hashcat/blob/56b322cf6e68a7d664f489e2a1e05cc0be748ed5/src/terminal.c#L438). Since conhost doesn't forward those buffer size changes to conpty, the two sides will likely end up out of sync, so it's inevitable the layout will break.
Author
Owner

@PankajBhojwani commented on GitHub (May 10, 2023):

Thank you for filing this! Thank you @j4james, yes this is a duplicate of #5094, please follow that thread for updates on this issue.

/dup #5094

@PankajBhojwani commented on GitHub (May 10, 2023): Thank you for filing this! Thank you @j4james, yes this is a duplicate of #5094, please follow that thread for updates on this issue. /dup #5094
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (May 10, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (May 10, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19819