Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
scukmh
V2EX  ›  Linux

不懂就问, zsh 为什么不能补全 sshfs

  •  
  •   scukmh · Apr 9, 2019 · 3440 views
    This topic created in 2673 days ago, the information mentioned may be changed or developed.

    for example

    [ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
    [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
    [ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
    [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
    hosts=(
      "$_ssh_config[@]"
      "$_global_ssh_hosts[@]"
    #  "$_ssh_hosts[@]"
      "$_etc_hosts[@]"
      "$HOST"
      localhost
    )
    zstyle ':completion:*:hosts' hosts $hosts
    

    比如上面这条可以补全 ssh, sftp, scp, rsync 同时不使用.ssh/known_hosts 中的内容

    但是这条并不能补全 sshfs

    but why?

    或者我想让 zsh 补全支持 sshfs, 我需要做点什么。

    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3300 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:05 · PVG 20:05 · LAX 05:05 · JFK 08:05
    ♥ Do have faith in what you're doing.