0

I might use arrow keys to go back and edit a flag when typing a command in my prompt and doing so constantly kicks me back from insert mode to normal mode. How do I turn this off so it matches the behavior of vim?

also in vim I can do this to get rid of the warning bells (which I use in some scenarios, so I dont want to mute them terminal wide) whenever a command is issued in normal mode that is unbound:

set noerrorbells visualbell t_vb=
if has('autocmd')
      autocmd GUIEnter * set visualbell t_vb=
  endif

Is there a way to turns system bells off for just the prompt?

edit to provide more information:

this is using reflection terminal editor or sshing through powershell. $TERM is set to xterm-256color in my .profile but commenting that out I get xterm in reflection and vt100 when using powershell. terminfo shows the term matching $TERM in all 3 cases and prompt behavior is the same in all configurations

OS is RHEL, the escape keys for my arrow keys are "\EOA \EOC \EOB \EOD" clockwise starting from arrow up which matches infocmp

4
  • What shell are you using? You seem to have tagged your question with both bash and ksh. Are you expecting answers from people who knows both shells?
    – Kusalananda
    Jun 30, 2022 at 12:55
  • I need to use both. The behavior is the same in either and I will accept a solution for one shell or the other, it will get me pointed in the right direction.
    – guest
    Jun 30, 2022 at 13:48
  • 1
    Likely to do with the terminfo entry for $TERM not matching your actual terminal. What's your terminal / terminal emulator, what is $TERM set to. What OS is it? infocmp -L1 | grep key output what escape sequences your array key send? Jun 30, 2022 at 15:38
  • @StéphaneChazelas I added more information
    – guest
    Jun 30, 2022 at 16:30

1 Answer 1

0

The value of the $TERM environment variable selects which terminfo entry is used by programs which interpret function key sequences and which control the cursor and the terminal screen with escape sequences, all using the ncurses and/or the libtinfo library.

For programs to behave properly the selected terminfo entry they are told to use must accurately describe the terminal or terminal emulator you are using to connect with the host running these programs.

According to at least one document for MicroFocus Reflection the default terminal emulation is "VT500-7", so if you haven't changed any settings in it then you should probably set $TERM to something like vt320, or maybe vt420 or vt420pc, though the ideal setting will depend on the exact version of the terminfo file on the host(s) you are connecting to.

As for powershell, well that's not a terminal emulator. Perhaps you mean the Windows Terminal? If so this is described as an ANSI terminal emulator (by default), but in most terminfo files there's a ms-terminal definition which might work better than plain ansi. Rumour is that Microsoft would like Terminal to be "as close to xterm-256color as possible", so it might work too, again depending on the version of the terminfo file on the particular host(s) you are connecting to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .