GNU/Linux >> Linux Esercitazione >  >> Linux

Quando si utilizza Putty, Alt-sinistra/destra è diverso quando Byobu viene avviato automaticamente dal profilo?

Quando si avvia una sessione, almeno nel mio caso, su macchine Debian e Ubuntu con Putty da una macchina Windows, alt-left/right funziona come spostamento per parola sulla riga di comando. (Spesso questo si ottiene anche su sistemi Linux con ctr-left/right ).

Tuttavia, una volta che ho iniziato a utilizzare Byobu, e imposta Byobu in modo che si avvii automaticamente (usando il menu F9), il alt-left/right non funziona più. Invece durante l'output dei caratteri grezzi usando Ctrl-V mostra,

 ^[[1;3C

— quando invii alt-right . Considerando che, quando byobu non viene avviato automaticamente all'accesso, ma viene avviato manualmente una volta effettuato l'accesso, ho dedotto che invia,

^[^[[C

Che viene catturato da una configurazione inputrc predefinita e, di conseguenza, viene tradotto in spostare per parola.

Quale meccanismo è in gioco tra Putty, host/terminal/byobu, per fare questa differenza nei comandi ricevuti?

Risposta accettata:

byobu è solo un wrapper attorno a tmux, che è responsabile del comportamento che stai vedendo. tmux sta tentando di tradurre "chiavi" nella sequenza di caratteri che xterm codificherebbe chiavi speciali modificate. Nel manuale è documentato:

         xterm-keys [on | off]
                 If this option is set, tmux will generate xterm(1) -style
                 function key sequences; these have a number included to
                 indicate modifiers such as Shift, Alt or Ctrl.  The
                 default is off.

sebbene nelle versioni nuove/recenti, secondo quanto riferito, l'impostazione predefinita è attiva . Ciò ha esposto un problema, visto in questo messaggio di commit:

commit d52f579fd5e7fd21d7dcf837780cbf98498b10ce
Author: nicm <nicm>
Date:   Sun May 7 21:25:59 2017 +0000

    Up to now, tmux sees \033\033[OA as M-Up and since we turned on
    xterm-keys by default, generates \033[1;3A instead of
    \033\033[OA. Unfortunately this confuses vi, which doesn't understand
    xterm keys and now sees Escape+Up pressed within escape-time as Escape
    followed by A.

    The issue doesn't happen in xterm itself because it gets the keys from X
    and can distinguish between a genuine M-Up and Escape+Up.

    Because xterm can, tmux can too: xterm will give us \033[1;3A (that is,
    kUP3) for a real M-Up and \033\033OA for Escape+Up - in fact, we can be
    sure any \033 preceding an xterm key is a real Escape key press because
    Meta would be part of the xterm key instead of a separate \033.

    So change tmux to recognise both sequences as M-Up for its own purposes,
    but generate the xterm version of M-Up only if it originally received
    the xterm version from the terminal.

    This means we will return to sending \033\033OA instead of the xterm key
    for terminals that do not support xterm keys themselves, but there is no
    practical way around this because they do not allow us to distinguish
    between Escape+Up and M-Up. xterm style escape sequences are now the de
    facto standard for these keys in any case.

    Problem reported by [email protected] and subsequently by Cecile Tonglet in GitHub
    issue 907.

Linux
  1. Quanti anni avevi quando hai iniziato a usare Linux?

  2. Windows:come impedire a Windows di sovrascrivere Grub quando si utilizza una macchina a doppio avvio?

  3. Il colore sanguina proprio quando si scrive uno script personalizzato in Byobu?

  4. Impedisci la chiusura di riquadro/finestra al completamento del comando – Tmux?

  5. Avvio di tmux tramite gnome-terminal

Iniziare con Tmux

Suggerimenti per l'utilizzo di tmux

Come impedire la disconnessione delle connessioni SSH a causa dell'inattività quando si utilizza MobaXterm

Rispondi automaticamente "Sì" quando usi apt-get install

Leggero ritardo quando si cambia modalità in vim usando tmux o screen

Modifica dell'indirizzo e-mail predefinito per gli account di sistema quando si utilizza sendmail