Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.55k stars 572 forks source link

ConEmu can't shown the gitui's main window, but Cmder can #2297

Open asmwarrior opened 3 years ago

asmwarrior commented 3 years ago

Versions

ConEmu build: 210314 x64 OS version: Windows 7 x64 Simplified Chinese edition Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): CMD

Problem description

I can't run gitui under ComEmu. When I type the command "gitui.exe", nothing shown on the screen, the whole screen is shown in background color.

Steps to reproduce

  1. download a gitui.exe from the zip file the site: Latest release, unzip the exe file to the current folder.
  2. start the ComEmu, cd to the current folder
  3. type the "gitui" to start the gitui, now the whole screen is blank(shown in background color)
  4. when I hit the CTRL+C to exit the gitui, now the whole screen will shown the gitui's dead window.
  5. at this time, the caret is at the left head of the screen.

Actual results

Strange this issue only happens in the ComEmu, but not happens in a derived tool Cmder | Console Emulator, gitui can start and shown the window correctly under Cmder.

I try to see what's the different between ComEmu and Cmder, but I can't find any. First, I see Cmder use a quite old ComEmu version(191012), but when I download the pure ComEmu 191012, and I still can't run gitui under ComEmu 191012. Second, I try to export the ComEmu's setting file from the Cmder and import the the pure ComEmu, but this issue still happens.

Additional files

Here is the screen shot (gif file when I try to run the gitui under ComEmu)

gitui_start_error

Maximus5 commented 3 years ago

Try to run gitui -l. https://github.com/extrawurst/gitui/tree/v0.13.0#diagnostics Perhaps its logfile will show something useful.

asmwarrior commented 3 years ago

Try to run gitui -l. https://github.com/extrawurst/gitui/tree/v0.13.0#diagnostics Perhaps its logfile will show something useful.

I just did that, and see the log file below, it looks like gitui doesn't show any error message

22:21:39 [TRACE] (1) gitui::app: [src\app.rs:295] update
22:21:39 [TRACE] (1) asyncgit::status: [asyncgit\src\status.rs:95] request: [hash: 13358305220839371542] (type: WorkingDir, untracked: true)
22:21:39 [TRACE] (1) asyncgit::status: [asyncgit\src\status.rs:95] request: [hash: 1941773425136744055] (type: Stage, untracked: true)
22:21:39 [TRACE] (3) asyncgit::status: [asyncgit\src\status.rs:152] status fetched: 1941773425136744055 (type: Stage, untracked: true)
22:21:39 [TRACE] (2) asyncgit::status: [asyncgit\src\status.rs:152] status fetched: 13358305220839371542 (type: WorkingDir, untracked: true)
22:21:39 [TRACE] (1) gitui::app: [src\app.rs:313] update_git: Status
22:21:39 [TRACE] (1) asyncgit::diff: [asyncgit\src\diff.rs:90] request
22:21:39 [TRACE] (1) gitui::app: [src\app.rs:313] update_git: Status
22:21:39 [TRACE] (1) asyncgit::diff: [asyncgit\src\diff.rs:90] request
22:21:39 [TRACE] (1) gitui::app: [src\app.rs:313] update_git: Diff
22:21:42 [TRACE] (1) gitui::app: [src\app.rs:229] event: Input(Mouse(MouseEvent { kind: Moved, column: 70, row: 12, modifiers: CONTROL }))
22:21:43 [TRACE] (1) gitui::app: [src\app.rs:229] event: Input(Key(KeyEvent { code: Char('c'), modifiers: CONTROL }))
Maximus5 commented 3 years ago

The problem is that gutui works on my pc, I can't reproduce...

Is there any difference, if you run it from ConEmu64.exe -basic -run cmd.exe ?

asmwarrior commented 3 years ago

I have reported this issue to cmder's issue, hope their devs can help.

More information: I just tried the same ConEmu in another PC, which is:

ConEmu build: 210314 x64
OS version: Windows 7 x64 Simplified Chinese edition

But the gitui still can't show the main window.

Maximus5 commented 3 years ago

Check your chcp?

asmwarrior commented 3 years ago

The problem is that gutui works on my pc, I can't reproduce...

Is there any difference, if you run it from ConEmu64.exe -basic -run cmd.exe ?

I just tried this, and the same blank screen issue if I start gitui.

asmwarrior commented 3 years ago

Some more information, I just try use another git command line tool: jesseduffield/lazygit: simple terminal UI for git commands And this tool works correctly inside the standalone ConEmu, see the screen shot below: lazygit-works-ok

asmwarrior commented 3 years ago

Check your chcp?

I just run some chcp command and then gitui, but still the same issue.

For example, I run chcp 437 or chcp 65001 which changes to English or UTF8 language page, but still the same issue.

Maximus5 commented 3 years ago

I mean check chcp result from cmder and ConEmu. You said in cmder it works, right? Also, compare console buffer heights.

asmwarrior commented 3 years ago

I mean check chcp result from cmder and ConEmu. You said in cmder it works, right?

Yes, gitui works under cmder. I just checked the chcp results of the two shells, they are the same, both are the 936 (Chinese GB2312)

Also, compare console buffer heights. I just check the setting dialog of both shells: open Settings / Size&Pos and see that console buffer height are different.

For cmder, it's 1000. For standalone ConEmu, it's 32766, I can change ConEmu's value to 1000, but still see the same issue of gitui.

Etherian commented 3 years ago

ConEmu build: 210422 x64 OS version: Windows 7 x64 Home Premium SP1 Used shell version: cmd, powershell, pwsh

I am still having this issue with GitUI 0.16.2, so I did some troubleshooting. While testing, I ran into a separate problem where GitUI's interface would become garbled, but that deserves its own issue.

The pertinent difference between ConEmu and Cmder seems to be in their init scripts, specifically the line if not defined TERM set TERM=cygwin in Cmder's script. Without TERM set, GitUI will display as a blank console on both ConEmu or Cmder using cmd, powershell, or pwsh . With TERM set to seemingly any value, GitUI will render correctly (except for the garbling) on every combination of ConEmu, Cmder, cmd, powershell, and pwsh.

If it helps, I also checked the "real console". GitUI appears on it even when the main console is blank, as shown below. The real console displays the GitUI interface while the main console remains blank.

Maximus5 commented 3 years ago

Just to be sure, is the option "Inject ConEmuHk" turned on?

Etherian commented 3 years ago

The "Inject ConEmuHk.dll" option is turned on in both my standalone ConEmu and my Cmder ConEmu.

asmwarrior commented 3 years ago

ConEmu build: 210422 x64 OS version: Windows 7 x64 Home Premium SP1 Used shell version: cmd, powershell, pwsh

I am still having this issue with GitUI 0.16.2, so I did some troubleshooting. While testing, I ran into a separate problem where GitUI's interface would become garbled, but that deserves its own issue.

The pertinent difference between ConEmu and Cmder seems to be in their init scripts, specifically the line if not defined TERM set TERM=cygwin in Cmder's script. Without TERM set, GitUI will display as a blank console on both ConEmu or Cmder using cmd, powershell, or pwsh . With TERM set to seemingly any value, GitUI will render correctly (except for the garbling) on every combination of ConEmu, Cmder, cmd, powershell, and pwsh.

If it helps, I also checked the "real console". GitUI appears on it even when the main console is blank, as shown below. The real console displays the GitUI interface while the main console remains blank.

Good catch, thanks for the testing!