Various msysgit bash (encoding related?) problems

611 views
Skip to first unread message

Francesco Pretto

unread,
Mar 28, 2012, 4:55:09 AM3/28/12
to msysGit
Hello, I'm having various problems with the integrated bash console.
Overall they are giving me a poor quality feeling on msysgit console
facility.
1) Contextual right mouse menu in the prompt doesn't work like other
windows prompts (nor is Properties->Options->QuickEdit Mode
enabled) .
You can reach the same usual functionalities (mark, copy, paste)
clicking on upper left window icon, but right mouse click just
doesn't
work (and it seems strange because the console seems basically a
standard prompt with bash as the interpreter);
2) I can't paste in the "~" and various accented characters "ùàòèì"
in
the console;
3) I can't type accented characters "ùàòèì" in the console;
4) ALT + code way of typing characters doesn't work. I can't for
example type ALT + 126 for typing " ~".

All these bugs are absent in the standard cmd.exe prompt. Default
codepage for prompts is 850. Truetype character (that will enable
unicode characters showing) is enabled for all prompts as msysgit
installer option.

My system is Windows 7 64 bit. I am seeing the same on Win XP
32bit. I have the feeling you'll notice these bugs more easily in a
non
en-us Windows installation.

Regards,
Francesco

Erik Faye-Lund

unread,
Mar 28, 2012, 11:40:54 AM3/28/12
to Francesco Pretto, msysGit
On Wed, Mar 28, 2012 at 10:55 AM, Francesco Pretto <cez...@gmail.com> wrote:
> Hello, I'm having various problems with the integrated bash console.
> Overall they are giving me a poor quality feeling on msysgit console
> facility.
> 1) Contextual right mouse menu in the prompt doesn't work like other
> windows prompts (nor is Properties->Options->QuickEdit Mode
> enabled) .
> You can reach the same usual functionalities (mark, copy, paste)
> clicking on upper left window icon, but right mouse click just
> doesn't
> work (and it seems strange because the console seems basically a
> standard prompt with bash as the interpreter);

This seems to work for me.

> 2) I can't paste in the "~" and various accented characters "ùàòèì"
> in
> the console;

I can paste '~', but not 'á'. Strange.

> 3) I can't type accented characters "ùàòèì" in the console;

Neither can I. Not good.

> 4) ALT + code way of typing characters doesn't work. I can't for
> example type ALT + 126 for typing " ~".

This works for me to the same extent as it does in CMD.exe. However, I
have to use ALT-GR, and not just any ALT, and ALT-GR+126 give me '@',
not '~'. Both in git-bash and in cmd. The latter point could be a
code-page difference, though. I'm using English Windows 7 (64 bit),
with a Norwegian keyboard.

karste...@dcon.de

unread,
Apr 3, 2012, 2:17:02 PM4/3/12
to Francesco Pretto, msysGit
Francesco Pretto <cez...@gmail.com> wrote on 28.03.2012 10:55:09:

> Hello, I'm having various problems with the integrated bash console.
> Overall they are giving me a poor quality feeling on msysgit console
> facility.
> 1) Contextual right mouse menu in the prompt doesn't work like other
> windows prompts (nor is Properties->Options->QuickEdit Mode
> enabled) .
> You can reach the same usual functionalities (mark, copy, paste)
> clicking on upper left window icon, but right mouse click just
> doesn't
> work (and it seems strange because the console seems basically a
> standard prompt with bash as the interpreter);

The msys.dll captures mouse input (via 'SetConsoleMode(...,
ENABLE_MOUSE_INPUT)') to support mouse tracking escape sequences
('\033[M<button><x><y>').

You can enable quick edit mode in your default console settings, that's
much easier to work with than the context menu (quick edit mode also
disables the context menu, btw.).

> 2) I can't paste in the "~"

This works for me. Make sure you're pasting a normal '~' character
(\u007e), not small tilde (\u02dc), tilde operator (\u223c) or combining
tilde (\u0303).

> and various accented characters "ùàòèì" in the console;
> 3) I can't type accented characters "ùàòèì" in the console;

You can try to enable 8-bit input in your etc/inputrc, but I guess this
only works properly if your system code page is CP1252 (because its mostly
identical to Unicode \u0000-\u00ff, which is used for output):
...
# disable/enable 8bit input
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off
...


I've tried to patch my msys.dll to support Unicode/UTF-8 console input,
but that doesn't help much because bash's readline doesn't support
multibyte-charsets (i.e. horizontal cursor movement is completely broken
if 1 byte != 1 character).

Compiling bash with multibyte charset support requires mbstate_t, mbrtowc,
mbsrtowcs, mbrlen and wcwidth from stdlib.h. These are available as of
newlib 1.18, but msys.dll comes with newlib 1.9 :-(

Any ideas how to fix this are welcome.

> 4) ALT + code way of typing characters doesn't work. I can't for
> example type ALT + 126 for typing " ~".

ReadConsoleInput reports the translated character in the key-up event of
the ALT key, however, the msys console handler discards all key-up events.
This is easy to fix, but of little use as long as we don't have a solution
to the bash/readline problem.


Ciao,
Karsten

Francesco Pretto

unread,
Apr 3, 2012, 3:39:03 PM4/3/12
to karste...@dcon.de, msysGit
2012/4/3 <karste...@dcon.de>:

> The msys.dll captures mouse input (via 'SetConsoleMode(...,
> ENABLE_MOUSE_INPUT)') to support mouse tracking escape sequences
> ('\033[M<button><x><y>').
>
> You can enable quick edit mode in your default console settings, that's
> much easier to work with than the context menu (quick edit mode also
> disables the context menu, btw.).
>

Ok. It would be great if Quick Edit is enabled by default in msysgit
bash, cause you can't enable it permanently, as far as I tried (I get
"Unable to modify the shortcut. Check to make sure it has not been
deleted or renamed" out of the prompt Properties dialog).

>> 2) I can't paste in the "~"
>
> This works for me. Make sure you're pasting a normal '~' character
> (\u007e), not small tilde (\u02dc), tilde operator (\u223c) or combining
> tilde (\u0303).
>

This really doesn't work for me. Actually my system is Windows 7
English with Italian internationalization (keyboard and clock). If I
try to paste the PS1 variable "ceztko@LAPTOPBB ~" in the msysgit bash
I can see only "ceztko@LAPTOPBB".

>> and various accented characters "ùàòèì" in the console;
>> 3) I can't type accented characters "ùàòèì" in the console;
>
> You can try to enable 8-bit input in your etc/inputrc, but I guess this
> only works properly if your system code page is CP1252 (because its mostly
> identical to Unicode \u0000-\u00ff, which is used for output):
> ...
> # disable/enable 8bit input
> set meta-flag on
> set input-meta on
> set output-meta on
> set convert-meta off
> ...
>

This somewhat works, thanks, but up to an extend. "àèìòù" work but no
€ char (everywhere else I type "Alt Gr" + "e" to get €).

>
> ReadConsoleInput reports the translated character in the key-up event of
> the ALT key, however, the msys console handler discards all key-up events.
> This is easy to fix, but of little use as long as we don't have a solution
> to the bash/readline problem.
>
>

Ok, thanks for being aware of all these problems for now.

Greetings,
Francesco

Paolo Di Patria

unread,
Aug 23, 2012, 9:58:16 AM8/23/12
to msy...@googlegroups.com, karste...@dcon.de, cez...@gmail.com

Hi Francesco,

    I was suffering from the same limitations you reported in this discussion thread.
My environment is Windows 7 Professional, Italian keyboard, and I use msys/mingw to work with Git for Windows.
I was able to overcome the lack of ~ character in the Italian layout by adding English (us) as both Installed Services and Input Language in the Regional settings configuration.
The keyboard layour have a precedence order, so I've set the Italian layout first, then En/Us for the Italian language, the opposite for English language.
When both are installed, I switch between them with a keyboard shortcut.
Obviously (!), the tilde character is only available when the US keyboard configuration is selected.


>> 2) I can't paste in the "~"
>
> This works for me. Make sure you're pasting a normal '~' character
> (\u007e), not small tilde (\u02dc), tilde operator (\u223c) or combining
> tilde (\u0303).
>

This really doesn't work for me. Actually my system is Windows 7
English with Italian internationalization (keyboard and clock). If I
try to paste the PS1 variable "ceztko@LAPTOPBB ~" in the msysgit bash
I can see only "ceztko@LAPTOPBB".

>> and various accented characters "ùàòèì" in the console;
>> 3) I can't type accented characters "ùàòèì" in the console;

Ok, thanks for being aware of all these problems for now.

Greetings,
Francesco


Hope this helps (if you did not figure out already, that is).

Cheers,

Paolo
Reply all
Reply to author
Forward
0 new messages