我想在最新的RHEL8中安装fishshell,我应该怎么做?问题描述:在fish官网发现没有提供RHEL8/CENTOS8的下载http://fishshell.com/如果直接配置软件源或者直接下载安装包,会遇到以下python错误。原因是对于RHEL8Python没有默认命令,也就是说没有/usr/bin/python,只有/usr/bin/python2或/usr/bin/python36等严格命令。我想这可能是安装提示Thereisaproblemwithpython的原因。解决方法:通过下面的源码安装,找到一个比较新版本的源码下载https://github.com/fish-shell...按照官网解压后编译安装cmake;制作;sudomakeinstall我在安装的时候也遇到了错误。查询后发现是缺少依赖。需要安装以下软件包。/fish如何配置fish对root用户生效?安装fish后有一些麻烦。一种是/usr/local/bin/fish只在普通用户的namespacePATH中,不在root用户中,所以不能使用,所以可以创建软连接到/usr/bin/fish或者添加/usr/local/bin到root用户的PATH,我遇到的另外一个问题就是fish_config执行错误。在fishshell中,fish_config命令可以提供一个网页进行配置,但是我觉得执行的时候出错问题是httpd,没有安装httpd,安装了之后也不行,然后我想是端口问题,8000端口没有问题,暂时不知道是什么原因。但是我的目的是配置fishshell。刚好我有原来的fishshell配置,所以想直接修改配置文件。我参考了这个文档https://www.cnblogs.com/sytfy...fish的配置文件目录是~/.config/fish/刚安装完目录下只有一个文件~/.config/fish/fish_variables需要新建一个functions文件夹和一个配置文件├──fish_variables└──functions└──functions/fish_prompt.fish复制一个最喜欢的配置文件到fish_prompt.fish我最喜欢的配置文件是functionfish_prompt#这个提示显示:#-如果最后一个返回命令正常,则为绿色,否则为红色#-你的用户名,如果是root则为红色,否则为黄色#-你的主机名,如果为ssh,则为青色否则为蓝色#-当前路径(使用prompt_pwd)#-date+%X#-当前的虚拟环境,如果有的话#-当前的git状态,如果有的话,带fish_git_prompt#-当前的电池状态,如果有的话,你的电源线是否拔掉,如果你有“acpi”#-当前后台作业,如果有的话#它来自:#┬─[nim@Hattori:~]─[11:39:00]#╰─>$echohere#To:#┬─[nim@Hattori:~/w/仪表板]─[11:37:14]─[V:django20]─[G:master↑1|●1?1…1]─[B:85%,05:41:42remaining]#│2150540%arrêtéesleep100000#│1150480%arrêtéesleep100000#╰─>$echothereset-lretcredtest$status=0;并设置retcgreenset-q__fish_git_prompt_showupstream或set-g__fish_git_prompt_showupstreamautofunction_nim_prompt_wrappersetretc$argv[1]setfield_name$argv[2]setfield_value$argv[3]set_colornormalset_color$rececho-n'─'set_color-ogreenecho-n'['set_colornormaltest-n$field_nameandecho-n$field_name:set_color$rececho-n$field_valueset_color-ogreenecho-n']'endset_color$rececho-n'┬─'set_color-ogreenecho-n[iftest"$USER"=root-o"$USER"=toorset_color-oredelseset_color-oyellowendecho-n$USERset_color-owhiteecho-n@if[-z"$SSH_CLIENT"]set_color-oblueelseset_color-ocyanendecho-n(prompt_hostname)set_color-owhiteecho-n:(prompt_pwd)set_color-ogreenecho-n']'回声-n@if[-z"$SSH_CLIENT"]#Date_nim_prompt_wrapper$rec''(date+%X)#虚拟环境set-qVIRTUAL_ENV_DISABLE_PROMPTorset-gVIRTUAL_ENV_DISABLE_PROMPTtrueset-qVIRTUAL_ENVand_nim_prompt_wrapper$recV(basename"$VIRTUAL_ENV")#git#setprompt_git(fish_git_prompt|stringtrim-c'()')#test-n"$prompt_git"#and_nim_prompt_wrapper$recG$prompt_git#电池状态类型-qacpiandtest(acpi-a2>/dev/null|stringmatch-roff)and_nim_prompt_wrapper$recB(acpi-b|cut-d''-f4-)#Newlineecho#Backgroundjobsset_colornormalforjobin(jobs)set_color$rececho-n'│'set_colorbrownecho$job结束set_color正常set_color$rececho-n'╰─>'set_color-oredecho-n'$'set_colornormalend然后我发现目录总是缩写,我不喜欢。也可以根据配置文件functions手动修改/usr/local/share/fish//prompt_pwd.fish将缩写注释掉后生效,保存退出
