LINUX.ORG.RU

В консоли не могу вставить квадратную открывающую скобку, как победить?


0

0

Скобка «[» просто не ставится при нажатии на соответствующую клавишу.

Это происходит в любой консоли и в konsole и даже если закрыть иксы.

Использую bash.

В остальных программах проблем нет, то есть спокойна скобка ставится в vim и MC.

★★★★

Ответ на: комментарий от keeper_b

Не занята ли эта самая открывающая скобка. Если inputrc никто не трогал, понятное дело, нужно копать в другом направлении.
Можете указать, после чего началась неисправность?

AITap ★★★★★
()
Ответ на: комментарий от AITap

>Можете указать, после чего началась неисправность?

К сожалению, нет. Эта проблемма существует очень давно, прамерно с установки ОС.

Знакомый как то посоветовал команду «set vi», после чего вроде работает но эту команду приходится набирать каждый раз, при открытии консоли.

keeper_b ★★★★
() автор топика
Ответ на: К.О. от philosoft

Добавлял, он его включает, но только скобка опять не работает, то есть эта команда работает только при непосредственном вводе (кстати, а сейчас вообще перестала).

keeper_b ★★★★
() автор топика
Ответ на: комментарий от GotF
# /etc/inputrc: initialization file for readline
#
# For more information on how this file works, please see the
# INITIALIZATION FILE section of the readline(3) man page
#
# Quick dirty little note:
#  To get the key sequence for binding, you can abuse bash.
#  While running bash, hit CTRL+V, and then type the key sequence.
#  So, typing 'ALT + left arrow' in Konsole gets you back:
#    ^[[1;3D
#  The readline entry to make this skip back a word will then be:
#    "\e[1;3D" backward-word
#

# do not bell on tab-completion
set bell-style none

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
#set editing-mode vi 

# Completed names which are symbolic links to
# directories have a slash appended.
set mark-symlinked-directories on

$if mode=emacs

# for linux console and RH/Debian xterm
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# mappings for "page up" and "page down" to step to the beginning/end 
# of the history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert
# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word

# gnome-terminal (escape + arrow key)
"\e[5C": forward-word
"\e[5D": backward-word
# gnome-terminal (control + arrow key)
"\e[1;5C": forward-word
"\e[1;5D": backward-word
# konsole / xterm / rxvt (escape + arrow key)
"\e\e[C": forward-word
"\e\e[D": backward-word
# konsole (alt + arrow key)
"\e[1;3C": forward-word
"\e[1;3D": backward-word
# konsole (control + arrow key)
"\e[1;3C": forward-word
"\e[1;3D": backward-word
# aterm / eterm (control + arrow key)
"\eOc": forward-word
"\eOd": backward-word

$if term=rxvt
"\e[8~": end-of-line
$endif

# for non RH/Debian xterm, can't hurt for RH/Debian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif

# fix Home and End for German users
"\e[7~": beginning-of-line
"\e[8~": end-of-line

"\e[A": history-search-backward
"\e[B": history-search-forward
 
[[ -f /etc/profile.d/bash-completion ]] && source /etc/profile.d/bash-completion

keeper_b ★★★★
() автор топика
Ответ на: комментарий от GotF

Не могу проверить, так как скобка то не ставится. :)

Попробовал схитрить написал:

#!/bin/bash

bind -r "\["

Но он ругается «line 3: bind: warning: line editing not enabled».

keeper_b ★★★★
() автор топика
Ответ на: комментарий от nnz

Не помогает.

Вывод «set -o».

 
allexport       off
braceexpand     on
emacs           on
errexit         off
errtrace        off
functrace       off
hashall         on
histexpand      on
history         on
ignoreeof       off
interactive-comments    on
keyword         off
monitor         on
noclobber       off
noexec          off
noglob          off
nolog           off
notify          off
nounset         off
onecmd          off
physical        off
pipefail        off
posix           off
privileged      off
verbose         off
vi              off
xtrace          off

keeper_b ★★★★
() автор топика
Ответ на: комментарий от keeper_b

А если вырезать эту инородно выглядящую строку?

[[ -f /etc/profile.d/bash-completion ]] && source /etc/profile.d/bash-completion

Это же явно не bash-скрипт

linuxfan
()
Ответ на: комментарий от GotF

Да, вроде бы всё работает. Непонятно только, как эта строка туда попала?. Всем спасибо!

keeper_b ★★★★
() автор топика
Ответ на: комментарий от keeper_b

Правильно запихнуть эту строку в /etc/profile, а еще правильнее, если там будет что-то вроде

for sh in /etc/profile.d/*.sh ; do
        [ -r "$sh" ] && . "$sh"
done
unset sh
linuxfan
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.