• 0 Posts
  • 24 Comments
Joined 2 years ago
cake
Cake day: June 13th, 2023

help-circle

  • It is very good, and I am currently using it. I don’t like its dependencies on GTK stuff, the developer is a little picky about what to support, and I dislike the +options style. Other than that, 👍 .

    Also great: Wezterm, Konsole, Rio. I’m excitedly following Rio’s development, which has a much smaller dependency list, and hopping back and forth between it and Ghostty/Wezterm. But it’s still got some things to iron out and features to develop.


  • It’s been a while, but my clumsy adding of a comment to the buffer is unnecessary, given zle -M, which will display a message outside of the buffer. So here’s an updated version:

    # -- Run input if single line, otherwise insert newline --
    # Key: enter
    # Credit: https://programming.dev/comment/2479198
    .zle_accept-except-multiline () {
      if [[ $BUFFER != *$'\n'* ]] {
        zle .accept-line
        return
      } else {
        zle .self-insert-unmeta
        zle -M 'Use alt+enter to submit this multiline input'
      }
    }
    zle -N       .zle_accept-except-multiline
    bindkey '^M' .zle_accept-except-multiline  # Enter
    
    # -- Run input if multiline, otherwise insert newline --
    # Key: alt+enter
    # Credit: https://programming.dev/comment/2479198
    .zle_accept-only-multiline () {
      if [[ $BUFFER == *$'\n'* ]] {
        zle .accept-line
      } else {
        zle .self-insert-unmeta
      }
    }
    zle -N         .zle_accept-only-multiline
    bindkey '^[^M' .zle_accept-only-multiline  # Enter
    




  • Andy@programming.devtoLinux@lemmy.mlbest linux terminal emulator
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    10 months ago

    For me: Wezterm. It does pretty much everything. I don’t think Alacritty/Kitty etc. offer anything over it for my usage, and the developer is a pleasure to engage with.

    Second place is Konsole – it does a lot, is easy to configure, and obviously integrates nicely with KDE apps.

    Honorable mention is Extraterm, which has been working on cool features for a long time, and is now Qt based.














  • Thanks again for posting your improvements! I will have them!

    The idea here, checking for newline characters rather than counting lines, is to prevent it treating one line that is so long it wraps to the next as counting as a multiline input, right? So now I’m looking like

    EDIT: lemmy is at least mangling ampersands here. Hard to believe it doesn’t have proper code blocks yet…

    # -- Run input if single line, otherwise insert newline --
    # Key: enter
    # Assumes: setopt interactivecomments
    # Credit: https://programming.dev/comment/2479198
    .zle_accept-except-multiline () {
      if [[ $BUFFER != *$'\n'* ]] {
        zle accept-line
        return
      } else {
        zle self-insert-unmeta
        if [[ $BUFFER == *$'\n'*$'\n'* ]] {
          local hint="# Use alt+enter to submit this multiline input"
          if [[ $BUFFER != *${hint}* ]] {
            LBUFFER+=$hint
            zle self-insert-unmeta
          }
        }
      }
    }
    zle -N .zle_accept-except-multiline
    bindkey '^M' .zle_accept-except-multiline  # Enter
    
    # -- Run input if multiline, otherwise insert newline --
    # Key: alt+enter
    # Credit: https://programming.dev/comment/2479198
    .zle_accept_only_multiline () {
      if [[ $BUFFER == *$'\n'* ]] {
        zle accept-line
      } else {
        zle self-insert-unmeta
      }
    }
    zle -N .zle_accept_only_multiline
    bindkey '^[^M' .zle_accept_only_multiline  # Enter
    

    For pushing the line/multiline, I combine it with my clear function (ctrl+l):

    # -- Refresh prompt, rerunning any hooks --
    # Credit: romkatv/z4h
    .zle_redraw-prompt () {
      for 1 ( chpwd $chpwd_functions precmd $precmd_functions ) {
        if (( $+functions[$1] ))  $1 &>/dev/null
      }
      zle .reset-prompt
      zle -R
    }
    
    # -- Better Screen Clearing --
    # Clear line and redraw prompt, restore line at next prompt
    # Key: ctrl+l
    # Depends: .zle_redraw-prompt
    .zle_push-line-and-clear () { zle push-input; zle clear-screen; .zle_redraw-prompt }
    zle -N       .zle_push-line-and-clear
    bindkey '^L' .zle_push-line-and-clear  # ctrl+l