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

ANSI colour handling for prompt seems broken in 0.4.3. #279

Closed
dkiestra opened this issue Jan 13, 2015 · 10 comments
Closed

ANSI colour handling for prompt seems broken in 0.4.3. #279

dkiestra opened this issue Jan 13, 2015 · 10 comments

Comments

@dkiestra
Copy link

Install Clink 0.4.3.
Open Command Prompt and type "set clink.prompt_colour=12".
However, prompt colour does not change.

Made sure there is no 3rd party software supporting ANSI colours.
Searched clink.log for "ANSI" string to look for LOG_INFO("Disabling ANSI support. Found '%s'", dll_name);, but none found.
Tried "set clink.ansi_code_support=1", but no luck.

@mridgers
Copy link
Owner

Strange. No problems for me. Are you certain there is not any ANSI codes already in the prompt? They would override the code's that Clink surrounds the prompt with for the "prompt_colour" setting.

@kosz78
Copy link

kosz78 commented Jan 20, 2015

@mridgers I have the same problem and when I set "ansi_code_support = 0" it display ANSI codes
07_57-clink

@mridgers
Copy link
Owner

"ansi_code_support = 0" will pass through ANSI codes so that other utilities can process them (as Clink's support for ANSI codes is "just enough" to do colours).

  • Can someone paste their log file please?
  • I wonder if this is a Win8+ problem (as I use Win7)?

@kosz78
Copy link

kosz78 commented Jan 21, 2015

@mridgers I use Win 8.1 this is my log file:

 7780 do_inject                  190 System: ver=6.2 0.0 arch=9 cpus=2 cpu_type=8664 page_size=4096
 7780 do_inject                  195 Version: 0.4.3
 7780 do_inject                  196 DLL: c:\SkyDrive\utils\clink\clink_dll_x64.dll
 7780 do_inject                  198 Parent pid: 3988
 7780 check_dll_version           50 DLL version: 00000004 00034dd8
 7780 do_inject                  268 Creating remote thread at 00007FF85B984960 with parameter 00000005420A0000
 3988 set_rl_readline_name        57 Setting rl_readline_name to 'cmd.exe'
 3988 hook_trap_veh              120 VEH hit - caller is 00007FF769EA1B78.
 3988 hook_jmp                   396 Attemping jump hook.
 3988 hook_jmp                   397 Target is kernelbase.dll, ReadConsoleW @ 00007FF859C60570
 3988 hook_jmp_impl              339 Attempting to hook at 00007FF859C60570 with 00007FF83F185E18
 3988 get_instruction_length     304 Matched prolog 8348F3FF (mask = 0000FFFF)
 3988 hook_jmp                   407 Success!
 3988 hook_iat                    77 Attempting to hook IAT for module 00007FF83F180000
 3988 hook_iat                    78 Target is (null),ReadConsoleW (by_name=1)
 3988 iterate_imports             94 Checking imports in 'dbghelp.dll'
 3988 iterate_imports             94 Checking imports in 'KERNEL32.dll'
 3988 hook_iat                   104 Found import at 00007FF83F1E1200 (value = 00007FF85BA435D0)
 3988 hook_iat                    77 Attempting to hook IAT for module 00007FF769EA0000
 3988 hook_iat                    78 Target is (null),WriteConsoleW (by_name=1)
 3988 iterate_imports             94 Checking imports in 'msvcrt.dll'
 3988 iterate_imports             94 Checking imports in 'ntdll.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-kernel32-legacy-l1-1-1.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-memory-l1-1-2.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-localization-l1-2-1.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-console-l1-1-0.dll'
 3988 hook_iat                   104 Found import at 00007FF769EEF388 (value = 00007FF859BB48F0)
 3988 hook_iat                    77 Attempting to hook IAT for module 00007FF83F180000
 3988 hook_iat                    78 Target is (null),WriteConsoleW (by_name=1)
 3988 iterate_imports             94 Checking imports in 'dbghelp.dll'
 3988 iterate_imports             94 Checking imports in 'KERNEL32.dll'
 3988 hook_iat                   104 Found import at 00007FF83F1E1178 (value = 00007FF85B984B40)
 3988 hook_iat                    77 Attempting to hook IAT for module 00007FF769EA0000
 3988 hook_iat                    78 Target is (null),SetEnvironmentVariableW (by_name=1)
 3988 iterate_imports             94 Checking imports in 'msvcrt.dll'
 3988 iterate_imports             94 Checking imports in 'ntdll.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-kernel32-legacy-l1-1-1.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-memory-l1-1-2.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-localization-l1-2-1.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-console-l1-1-0.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-libraryloader-l1-2-0.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-file-l1-2-1.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-errorhandling-l1-1-1.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-handle-l1-1-0.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-string-l1-1-0.dll'
 3988 iterate_imports             94 Checking imports in 'api-ms-win-core-processenvironment-l1-2-0.dll'
 3988 hook_iat                   104 Found import at 00007FF769EEF508 (value = 00007FF859BAB4D0)
 3988 hook_iat                    77 Attempting to hook IAT for module 00007FF83F180000
 3988 hook_iat                    78 Target is (null),SetEnvironmentVariableW (by_name=1)
 3988 iterate_imports             94 Checking imports in 'dbghelp.dll'
 3988 iterate_imports             94 Checking imports in 'KERNEL32.dll'
 3988 hook_iat                   104 Found import at 00007FF83F1E1190 (value = 00007FF85B982FC0)

@blumf
Copy link

blumf commented Jan 26, 2015

I'm having the same problem too, ANSI codes are ignored.
Clink 0.4.3, Win7-64

@mridgers mridgers mentioned this issue Feb 2, 2015
@mridgers
Copy link
Owner

mridgers commented Feb 2, 2015

I think I've got to the bottom of this. Can someone confirm that prompt_colour works as expected using the following build?

https://www.dropbox.com/sh/g7igxrrwpiyyhl1/AABVUIUG_ONDEsmPWTKLAR-Ea

@kosz78
Copy link

kosz78 commented Feb 3, 2015

Yes, it works fine for me, thank You

@dkiestra
Copy link
Author

dkiestra commented Feb 3, 2015

Yes, this build is working for me too.

Best regards, Douwe.

On 2015-02-03 04:39, Martin Ridgers wrote:

I think I've got to the bottom of this. Can someone confirm that
prompt_colour works as expected using the following build?

https://www.dropbox.com/sh/g7igxrrwpiyyhl1/AABVUIUG_ONDEsmPWTKLAR-Ea


Reply to this email directly or view it on GitHub
#279 (comment).

@blumf
Copy link

blumf commented Feb 3, 2015

Works here, thanks.

@mridgers
Copy link
Owner

mridgers commented Feb 3, 2015

Great, thanks for giving it a try everyone. I'll cut a 0.4.4 once I can compile XP-compatible executables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants