<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>15628</bug_id>
          
          <creation_ts>2008-05-12 22:08:47 +0400</creation_ts>
          <short_desc>/etc/inputrc: Ctrl-arrows in xterm don&apos;t work</short_desc>
          <delta_ts>2010-05-29 02:25:00 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>setup</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>22021</blocked>
    
    <blocked>18383</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Alexey Gladkov">legion</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>legion</cc>
    
    <cc>php-coder</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
    
    <cc>wrar</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69754</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-12 22:08:47 +0400</bug_when>
    <thetext>xterm-235-alt1

I expect (in bash) Ctrl-Left/Right to jump over words, Alt-Backspace to delete
the word to the left. aterm does this, xterm doesn&apos;t.
Steps to Reproduce:
1.start xterm
2.type &quot;aaaa bbbb cccc&quot;
3. Press Ctrl-Left
4. Press Alt-BkSp
Actual Results:  
3. aaaa bbbb cccc5D (and a beep)
4. aaaa bbbb cccc5

Expected Results:  
As in aterm-1.0.1-alt2:
3. (the cursor moved one word left)
4. aaaa cccc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69758</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 00:16:01 +0400</bug_when>
    <thetext>One part of this bug is also valid for gnome-terminal --
https://bugzilla.altlinux.org/show_bug.cgi?id=15629 .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69760</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 00:23:16 +0400</bug_when>
    <thetext>One part of this bug (Ctrl-arrows) is also valid for konsole from KDE3 --
https://bugzilla.altlinux.org/show_bug.cgi?id=15630 .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69769</commentid>
    <comment_count>3</comment_count>
    <who name="Slava Semushin">php-coder</who>
    <bug_when>2008-05-13 09:43:35 +0400</bug_when>
    <thetext>Ctrl-Left/Right у меня не работает, как и у вас. А вот Alt-Backspace удаляет
слово. Проверил на xterm 234-alt2/235-alt1

Полагаю, что тут ещё termcap/terminfo как-то замешены (у меня terminfo-5.6-alt3).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69774</commentid>
    <comment_count>4</comment_count>
    <who name="Andrey Rahmatullin">wrar</who>
    <bug_when>2008-05-13 10:10:04 +0400</bug_when>
    <thetext>Прежде чем вешать пицот одинаковых багов на пицот терминалов, неплохо бы 1) 
разобраться, какие терминальные последовательность генерят обсуждаемые 
комбинации клавиш; 2) о каких вообще программах речь; 3) как эти программы 
настроены реагировать на заданные последовательности.
В любом случае это скорее баг этих программ.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69775</commentid>
    <comment_count>5</comment_count>
    <who name="Andrey Rahmatullin">wrar</who>
    <bug_when>2008-05-13 10:23:35 +0400</bug_when>
    <thetext>Так вот, в данном случае все упомянутые терминалы генерят \e[1;5D и \e[1;5C, а 
aterm - \eOd и \eOc (что упомянуто в /etc/inputrc как &quot;on some exotic xterms&quot;).
Впишите в /etc/inputrc
&quot;\e[1;5D&quot;: backward-word
&quot;\e[1;5C&quot;: forward-word
и будет вам щастье.
Перевешиваю на setup, дубликаты сами закрывайте, раз вам это так нравится.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69776</commentid>
    <comment_count>6</comment_count>
    <who name="Slava Semushin">php-coder</who>
    <bug_when>2008-05-13 10:27:43 +0400</bug_when>
    <thetext>Reassign to real maintainer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69839</commentid>
    <comment_count>7</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 21:30:01 +0400</bug_when>
    <thetext>(In reply to comment #3)
&gt; Ctrl-Left/Right у меня не работает, как и у вас. А вот Alt-Backspace удаляет
&gt; слово. Проверил на xterm 234-alt2/235-alt1

Да, спасибо, проблема с Alt-Backspace где-то у меня, буду искать. (При этом во
всех других терминалах её нет.)

&gt; Полагаю, что тут ещё termcap/terminfo как-то замешены (у меня terminfo-5.6-alt3).

Поставил terminfo-5.6-alt4, пока так же.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69840</commentid>
    <comment_count>8</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 21:53:17 +0400</bug_when>
    <thetext>(In reply to comment #5)
&gt; Так вот, в данном случае все упомянутые терминалы генерят \e[1;5D и \e[1;5C, а 
&gt; aterm - \eOd и \eOc (что упомянуто в /etc/inputrc как &quot;on some exotic xterms&quot;).

Спасибо за объяснение! Экзотические -- это: aterm-1.0.1-alt2, Eterm-0.9.3-alt2,
rxvt-unicode-9.02-alt1.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69842</commentid>
    <comment_count>9</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 21:54:42 +0400</bug_when>
    <thetext>*** Bug 15632 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69844</commentid>
    <comment_count>10</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 21:54:54 +0400</bug_when>
    <thetext>*** Bug 15630 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69846</commentid>
    <comment_count>11</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-13 21:55:01 +0400</bug_when>
    <thetext>*** Bug 15629 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69847</commentid>
    <comment_count>12</comment_count>
    <who name="Andrey Rahmatullin">wrar</who>
    <bug_when>2008-05-13 22:11:07 +0400</bug_when>
    <thetext>генерация разными терминалами разных кодов - не проблема readline, привет</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69861</commentid>
    <comment_count>13</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-14 00:35:27 +0400</bug_when>
    <thetext>(In reply to comment #12)
&gt; генерация разными терминалами разных кодов - не проблема readline, привет

Если оно хочет на них одинаково реагировать, то это проблема для readline (нужно
учесть и те коды, и другие).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69862</commentid>
    <comment_count>14</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-05-14 00:39:21 +0400</bug_when>
    <thetext>(In reply to comment #7)
&gt; &gt; Ctrl-Left/Right у меня не работает, как и у вас. А вот Alt-Backspace удаляет
&gt; &gt; слово. Проверил на xterm 234-alt2/235-alt1
&gt; 
&gt; Да, спасибо, проблема с Alt-Backspace где-то у меня, буду искать. (При этом во
&gt; всех других терминалах её нет.)

Да, это было исправлено в app-defaults-0.2.8.4-alt1 (*VT100.Translations).
Извините за беспокойство!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83593</commentid>
    <comment_count>15</comment_count>
    <who name="Sergey Vlasov">vsu</who>
    <bug_when>2008-12-28 23:17:29 +0300</bug_when>
    <thetext>А вот в vim ситуация обратная - последовательности, выдаваемые xterm, обрабатываются правильно, а то, что выдаёт urxvt, не распознаётся.

На самом деле \e[1;5D - это частный случай общей обработки модификаторов, используемой в xterm:

In normal mode, i.e., a Sun/PC keyboard when the sunKeyboard resource is
false, xterm recognizes function key modifiers which are parameters
appended before the final character of the control sequence.

                      Code     Modifiers
                    ---------------------------------
                       2       Shift
                       3       Alt
                       4       Shift + Alt
                       5       Control
                       6       Shift + Control
                       7       Alt + Control
                       8       Shift + Alt + Control
                    ---------------------------------

For example, shift-F5 would be sent as CSI 1 5 ; 2 ~
If the alwaysUseMods resource is set, the Meta modifier also is recog-
nized, making parameters 9 through 16.

(на самом деле просто к значению битовой маски модификаторов добавлена единица, поскольку отсутствующий параметр после CSI считается по умолчанию равным 1, а не 0).

В /etc/inputrc от opensuse-11.0 (в пакете aaa_base) есть довольно много вариантов этих кодов, часть внутри $if term=xterm, $if term=rxvt-unicode или прочих вариантов; видимо, наш /etc/inputrc изрядно протух.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109474</commentid>
    <comment_count>16</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2010-05-26 20:48:57 +0400</bug_when>
    <thetext>(In reply to comment #15)
&gt; В /etc/inputrc от opensuse-11.0 (в пакете aaa_base) есть довольно много
&gt; вариантов этих кодов, часть внутри $if term=xterm, $if term=rxvt-unicode или
&gt; прочих вариантов; видимо, наш /etc/inputrc изрядно протух.

Там присвоено одно и то же действие для всех модификаторов и их сочетаний, например:
&quot;\e[2C&quot;:	forward-word
&quot;\e[1;2C&quot;:	forward-word
&quot;\e[1;3C&quot;:	forward-word
&quot;\e[1;4C&quot;:	forward-word
&quot;\e[5C&quot;:	forward-word
&quot;\e[1;5C&quot;:	forward-word
&quot;\e[1;6C&quot;:	forward-word
&quot;\e[1;7C&quot;:	forward-word
&quot;\e[1;8C&quot;:	forward-word

Имеет ли смысл нам поступить так же?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109527</commentid>
    <comment_count>17</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2010-05-29 02:25:00 +0400</bug_when>
    <thetext>setup-2.2.13-alt1 -&gt; sisyphus:

* Thu May 27 2010 Dmitry V. Levin &lt;ldv@altlinux&gt; 2.2.13-alt1
- /etc/profile.d/lang.*sh: do not source i18n files if
  non-empty LANG is already set (closes: #11814).
- /etc/services: updated SANE entries (closes: #13071).
- /etc/inputrc: added bindings for xterm ctrl-arrows (closes: #15628).
- /etc/profile.d/tmpdir.*sh: do not create ~/tmp directory (closes: #19014).
- /etc/filesystems: replaced obsolete content with a comment hinting
  on the purpose of this file (closes: #21082).
- /etc/inputrc: added bindings for history search (closes: #22570).
- /etc/securetty: added xvc0 for xen virtual console (closes: #23532).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>