Bug 341209 - Alt+character produces characters with diacritics (ÊÊËÊËÌÌ)
Summary: Alt+character produces characters with diacritics (ÊÊËÊËÌÌ)
Status: RESOLVED DOWNSTREAM
Alias: None
Product: konsole
Classification: Applications
Component: keyboard (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 02:20 UTC by Constantine Tsardounis
Modified: 2014-12-13 20:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
vim rc (3.65 KB, text/plain)
2014-11-24 02:20 UTC, Constantine Tsardounis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Constantine Tsardounis 2014-11-24 02:20:09 UTC
Created attachment 89707 [details]
vim rc

I do not know if it's a bug or a feature, but it does not happen with xterm so I decided to post it.

In vim when we type Alt+L in insert mode it goes to normal mode. To avoid this behavior according to http://vim.wikia.com/wiki/Fix_meta-keys_that_break_out_of_Insert_mode I added in my ~/.vimrc these lines:
'''
" fix meta-keys which generate <Esc>a .. <Esc>z
let c='a'
while c <= 'z'
  exec "set <M-".toupper(c).">=\e".c
  exec "imap \e".c." <M-".toupper(c).">"
  let c = nr2char(1+char2nr(c))
endw
'''
In xterm the above works, but in Konsole when I type Alt+J or +K or +L I get Ê Ë Ì  respectively which is not what I want. 

I encounter this problem because I want to be able to write with "polymorphic Alt Key Macros" as described in 3.10.1 at http://vim-latex.sourceforge.net/documentation/latex-suite.html

So when I open a .tex file with 

vim test.tex

and I type i to go into insert mode and then left parenthesis and then Alt+L like:

(<<<press Alt+L>>>

I want to get (as vim-latex-suite dictates):

\left(\right)<++>

Instead, the Alt-Key binding does not work and I get an accented "I":

(Ì 


I attach my ~/.vimrc for easier reproducibility.

Thanks!
Comment 1 Constantine Tsardounis 2014-11-24 02:21:09 UTC
Is there a quick fix/workaround?
Comment 2 Paul Evans 2014-11-24 15:00:08 UTC
(reposting my mailing list post:)

This is a bug in vim.

vim itself can't cope with the distinction between Alt+letter keys, and
Unicode characters. This has nothing to do with the terminal.

For more background on the subject, see my infamous "Dear Bram" thread
on vim-dev:

  https://groups.google.com/forum/#!topic/vim_dev/2bp9UdfZ63M[1-25-false]
Comment 3 Constantine Tsardounis 2014-11-25 18:32:38 UTC
Thank you for your fast reply. A lot of people requested this and after 3+ years it's still active! 

However, why do I have the feeling that it should work? 

Why does it work In xterm, then?
Comment 4 Constantine Tsardounis 2014-11-25 20:34:41 UTC
I suppose you can close this listing. It's kind of a babel tower and is quite sufficiently explained on: http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal 
I was quite emotional and perturbed on being forced to abandon konsole in favor of xterm+uxterm 
I discovered that I can get "\left(\right)<++>" just by double-typing "((". So I am fine and happy with konsole. :)  All the best and thanks!