ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Mac下CoreShell使用lrzsz命令

2021-04-18 14:02:28  阅读:306  来源: 互联网

标签:Core Shell url lrzsz bashrc Mac ch CoreShell path


  • Mac下Core Shell 使用lrzsz命令,上传,下载文件
  • 新增~/.bashrc_Core_Shell
# Bash support for Core Shell, reference: /etc/bashrc_Apple_Terminal on macOS

# Report Working Directory
#
# Tell the Core Shell about the current working directory at each prompt.

if [ -z "$INSIDE_EMACS" ]; then
    update_coreshell_cwd() {
        # Identify the directory using a "file:" scheme URL, including
        # the host name to disambiguate local vs. remote paths.

        # Percent-encode the pathname.
        local url_path=''
        {
            # Use LC_CTYPE=C to process text byte-by-byte. Ensure that
            # LC_ALL isn't set, so it doesn't interfere.
            local i ch hexch LC_CTYPE=C LC_ALL=
            for ((i = 0; i < ${#PWD}; ++i)); do
                ch="${PWD:i:1}"

                if [[ "$ch" =~ [/._~A-Za-z0-9-] ]]; then
                    url_path+="$ch"
                else
                    printf -v hexch "%02X" "'$ch"
                    # printf treats values greater than 127 as
                    # negative and pads with "FF", so truncate.
                    url_path+="%${hexch: -2:2}"
                fi
            done
        }

        if [ -n "$TMUX" ]; then
            printf '\ePtmux;\e\e]7;%s\a\e\\' "file://$HOSTNAME$url_path"
        else
            printf '\e]7;%s\a' "file://$HOSTNAME$url_path"
        fi
    }

    PROMPT_COMMAND="update_coreshell_cwd${PROMPT_COMMAND:+; $PROMPT_COMMAND}"
fi
  • 再执行如下命令
~/.bashrc_Core_Shell && grep -qs ".bashrc_Core_Shell" ~/.bash_profile || echo $'\n[[ -n "$SSH_TTY" || -n "$SSH_CONNECTION" ]] && [ -r "$HOME/.bashrc_Core_Shell" ] && . "$HOME/.bashrc_Core_Shell"' >> ~/.bash_profile

标签:Core,Shell,url,lrzsz,bashrc,Mac,ch,CoreShell,path
来源: https://www.cnblogs.com/xujunkai/p/14673292.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有