有可能追踪我的外壳(bash、fish、zsh)吗



我正在运行archlinux(具体来说是arcolinux发行版(,一切都很好,但有一个小问题让我很恼火,问题是每次我打开终端时,它都会弹出终端的顶部

";Linux pengu 5.15.25-1-lts x86_64未知">

我知道这是一个带有自定义标志的uname命令,但我的config.fish中没有它(我使用fish shell(我用bash I运行fish(,我知道每次我打开我的fish shell时,config.fish运行中的东西,我缺少什么吗?这是我的配置文件:


{

fish_vi_key_bindings
set VIRTUAL_ENV_DISABLE_PROMPT "1"
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
## Export variable need for qt-theme
if type "qtile" >> /dev/null 2>&1
set -x QT_QPA_PLATFORMTHEME "qt5ct"
end
# Set settings for https://github.com/franciscolourenco/done
set -U __done_min_cmd_duration 10000
set -U __done_notification_urgency_level low

## Environment setup
# Apply .profile: use this to put fish compatible .profile stuff in
if test -f ~/.fish_profile
source ~/.fish_profile
end
# Add ~/.local/bin to PATH
if test -d ~/.local/bin
if not contains -- ~/.local/bin $PATH
set -p PATH ~/.local/bin
end
end
# Add depot_tools to PATH
if test -d ~/Applications/depot_tools
if not contains -- ~/Applications/depot_tools $PATH
set -p PATH ~/Applications/depot_tools
end
end
set -p PATH ~/.scripts
set -p PATH /home/omar/eclipse/java-2021-12/eclipse
set -p PATH ~/bin

## Starship prompt
if status --is-interactive
source ("/usr/bin/starship" init fish --print-full-init | psub)
end
## Advanced command-not-found hook
#source /usr/share/doc/find-the-command/ftc.fish
## Functions
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
function __history_previous_command
switch (commandline -t)
case "!"
commandline -t $history[1]; commandline -f repaint
case "*"
commandline -i !
end
end
function __history_previous_command_arguments
switch (commandline -t)
case "!"
commandline -t ""
commandline -f history-token-search-backward
case "*"
commandline -i '$'
end
end
if [ "$fish_key_bindings" = fish_vi_key_bindings ];
bind -Minsert ! __history_previous_command
bind -Minsert '$' __history_previous_command_arguments
else
bind ! __history_previous_command
bind '$' __history_previous_command_arguments
end
# Fish command history
function history
builtin history --show-time='%F %T '
end
function backup --argument filename
cp $filename $filename.bak
end
# Copy DIR1 DIR2
function copy
set count (count $argv | tr -d n)
if test "$count" = 2; and test -d "$argv[1]"
set from (echo $argv[1] | trim-right /)
set to (echo $argv[2])
command cp -r $from $to
else
command cp $argv
end
end
## Useful aliases
#Aliases to setbrightness
alias setbright1='xrandr --output HDMI-0 --brightness 1.00' #Sets the brightness to 1.00
alias setbright75='xrandr --output HDMI-0 --brightness 0.75' #Sets the brightness to 0.75
alias setbright50='xrandr --output HDMI-0 --brightness 0.50' #Sets the brightness to 0.50
alias setbright40='xrandr --output HDMI-0 --brightness 0.40' #Sets the brightness to 0.40
alias setbright30='xrandr --output HDMI-0 --brightness 0.30' #Sets the brightness to 0.30
# Replace ls with exa
alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
alias la='exa -a --color=always --group-directories-first --icons'  # all files and dirs
alias ll='exa -l --color=always --group-directories-first --icons'  # long format
alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
alias l.="exa -a | egrep '^.'"                                     # show only dotfiles
# Aliases for quickly accessing config files(fish, bash, alacritty,etc..)
alias cf='vim ~/.config/fish/config.fish' # for quickly accessing fish config file
alias cb='vim .bashrc' # for quickly accessing bash config file
alias ca='vim ~/.config/alacritty/alacritty.yml' # for quickly acssesing alacritty config file
alias ck='vim ~/.config/kitty/kitty.conf'
alias cw='vim ~/.config/awesome/rc.lua'
# Replace some more things with better alternatives
alias cat='bat --style header --style rules --style snip --style changes --style header'
[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru'
#Media player utilities
alias pause='playerctl -p spotify pause'
alias play='playerctl -p spotify play'
# Common use
alias book='/home/omar/.scripts/books.sh'
alias poweroff='systemctl poweroff'
alias reboot='systemctl reboot'
alias grubup="sudo update-grub"
alias fixpacman="sudo rm /var/lib/pacman/db.lck"
alias tarnow='tar -acf '
alias untar='tar -zxvf '
alias wget='wget -c '
alias rmpkg="sudo pacman -Rdd"
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
alias upd='/usr/bin/update'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias hw='hwinfo --short'                                   # Hardware Info
alias big="expac -H M '%mt%n' | sort -h | nl"              # Sort installed packages according to size in MB
alias gitpkg='pacman -Q | grep -i "-git" | wc -l'          # List amount of -git packages
# Get fastest mirrors
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
# Help people new to Arch
alias apt='man pacman'
alias apt-get='man pacman'
alias please='sudo'
alias tb='nc termbin.com 9999'
# Cleanup orphaned packages
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
# Get the error messages from journalctl
alias jctl="journalctl -p 3 -xb"
# Recent installed packages
alias rip="expac --timefmt='%Y-%m-%d %T' '%lt%n %v' | sort | tail -200 | nl"
#Cool terminal stuff(pipes, convo, etc...)
alias pipes='cd pipes.sh;./pipes.sh';cd 
## Run paleofetch if session is interactive
#if status --is-interactive
#colorscript random
#end

}

我试图通过在我的鱼壳上调用strace之类的东西来调试这个问题,但它只是重新启动了我的鱼外壳。我还写了一个小脚本,在其中我进行了一个while循环,并执行了以下命令:ps-ax|grep uname;睡眠0.1它应该给我uname命令的任何实例我一直在一遍又一遍地跑我的鱼壳,但没有明确的例子我真的对这个感到困惑

您可以通过设置fish_trace变量来要求fish输出它运行的命令。示例:

fish_trace=1 fish

关于调试fish的文档中提到了这一点。

strace可以使用-p:连接到进程

-p pid         trace process with process id PID, may be repeated

通过这种方式,您将能够连接到正在运行的进程。

你也可以找到有用的

-f             follow forks
-ff            follow forks with output into separate files

如果附加到父进程。

我发现了这一点,尽管没有跟踪鱼壳系统调用或类似的东西,我意识到我正在使用哦,我的鱼插件或框架,它正在加载一个显示不需要的消息的主题,谢谢你的提示,尽管我至少现在知道如何跟踪鱼壳

最新更新