Projects STRLCPY fzf Commits b9e6e792
🤬
  • [bash] Fix completion of var or alias containing newlines (#2952)

    * Fix bash completion var or aliase containing newlines
    
    * Support for various bash declare options
    
    Co-authored-by: knutze <[email protected]>
  • Loading...
  • knutze committed with GitHub 2 years ago
    b9e6e792
    1 parent 845034c8
  • ■ ■ ■ ■ ■ ■
    shell/completion.bash
    skipped 287 lines
    288 288   
    289 289  _fzf_var_completion() {
    290 290   _fzf_complete -m -- "$@" < <(
    291  - declare -xp | sed 's/=.*//' | sed 's/.* //'
     291 + declare -xp | sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'
    292 292   )
    293 293  }
    294 294   
    295 295  _fzf_alias_completion() {
    296 296   _fzf_complete -m -- "$@" < <(
    297  - alias | sed 's/=.*//' | sed 's/.* //'
     297 + alias | sed -En 's|^alias ([^=]+).*|\1|p'
    298 298   )
    299 299  }
    300 300   
    skipped 80 lines
Please wait...
Page is in error, reload to recover