Posixモードでbashを完了

Posixモードでbashを完了

インタラクティブなPosix bashシェルを使用したいのですが、オートコンプリート機能は機能しません。タブを入力すると、タブのみが印刷されます。タブ補完機能は、Posix以外のシェルまたはEmacs入力モードを持つPosixシェルにある場合にのみ機能します。私は入力モードに慣れているので、Emacsの入力モードはぎこちないと思いますvishコマンドを使用してbashを呼び出すことは役に立ちません。

これは私のものです/etc/inputrc

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

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

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

set editing-mode vi
set keymap vi-insert
set mark-modified-lines on

$if mode=emacs

# for Linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# commented out keymappings for pgup/pgdown to reach begin/end of history
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word

# for rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word

# 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

ベストアンサー1

チェットレイミ説明する:

POSIXモードでは、タブマッピングを介してvi編集モードを実行しないでください。これは、POSIX.2がvi編集モードの動作を完全に指定し、標準ではタブがデフォルトで自己挿入にマッピングされることを要求するためです。

次の行を追加します~/.inputrcTAB: complete

または、bind 'TAB: complete'次に追加することもできます。~/.bashrc

おすすめ記事