V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
scukmh
V2EX  ›  Linux

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

  •  
  •   scukmh · 2019-04-09 17:38:42 +08:00 · 2826 次点击
    这是一个创建于 1837 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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, 我需要做点什么。

    1 条回复    2019-04-09 19:16:27 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1235 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:52 · PVG 01:52 · LAX 10:52 · JFK 13:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.