Article 6P4QE Problem with zsh, I can't find a solution

Problem with zsh, I can't find a solution

by
llevyperuchi
from LinuxQuestions.org on (#6P4QE)
Hey guys, let's go. I started messing around with Linux recently, about a week ago. Let me give you an introduction.

During this week, I've made a lot of mistakes. I even started a GNU course. I've formatted this notebook I'm using for learning about 14 times. It has an SSD and two 1TB external HDDs connected, so I switched between them. I installed distros like Mint, Ubuntu, POP OS, Fedora 40, Arch, Manjaro, and Debian. After this journey, where I installed .zsh from the first format, I faced several issues like plugins installed in the wrong places, typos in configuration files, and corrupted distros, among other problems. Through this, I learned a lot about formatting and partitioning, among many other things. Yesterday, I decided to explore Virtual Machines (I don't plan on formatting any of the 3 distros I'm using to get to know and learn both the distro and the GUIs). I'm currently using Mint Cinnamon, Debian 12.2 KDE 5, and Fedora 40 KDE Plasma 6.

My problem is only with this Debian KDE.

I followed all the steps from a GitHub repository that seemed to work smoothly on most of the distros I installed."

And here's the link mentioned in the text: https://github.com/vaamonde/dell-lin...re/06-tilix.md
"I recommend, in case anyone wants to, also install the Tilix terminal.
I did the process exactly as it's there. In the end, when I went to configure it, unlike the others, in the plugin configuration, there were some differences. Initially, I couldn't find the Python symbol as described in the first instructions, and the symbols overlapped the letters, but that was the only difference. At the end of the installation, everything seemed fine except that there was an error in the 'root' login, like /root/.zshrc:8: command not found: #. I spent hours here trying to restore the file and reinstall the plugins until I discovered that the 'K' plugin was in the wrong folder, so I moved it to the correct one, and the problem disappeared.
However, what was still happening was that when entering root mode, instead of entering directly into zsh, I had to type zsh every time, whereas in the home directory it went directly. Well, I ended up executing an instruction to copy the home folder to root and also copied zshc. In conclusion, everything went wrong, so I restored the folder and the previous file, and magically, the problem of entering root automatically was solved.
BUTTTTT there's always a BUTTTTT.
Now I keep seeing:
/home/user/.zshrc:1: command not found: #/root/.zshrc:1: command not found: #
I've searched everywhere and can't find a solution. I don't know what to do. I tried uninstalling and reinstalling (I'm not sure if the methods I learned were enough to delete all plugins and zsh), but even so, I'm back to the same starting point of the error. I even installed something called piratehack, a package that claims to fix errors like this, but it didn't help at all. Today, I spent around 5 hours due to my lack of experience with the system, moving from one problem to another. This is my first forum where I've entered as a user to post a question because I couldn't find anything on Google that solved it."

I removed the firts line and the error continues, look my configuration:
/root

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH

# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL10K_MODE="nerdfont-complete"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':eek:mz:update' mode disabled # disable automatic updates
# zstyle ':eek:mz:update' mode auto # update automatically without asking
# zstyle ':eek:mz:update' mode reminder # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':eek:mz:update' frequency 13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-syntax-highlighting
fzf
zsh-autosuggestions
k
)
source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by Oh My Zsh libs,
# plugins, and themes. Aliases can be placed here, though Oh My Zsh
# users are encouraged to define aliases within a top-level file in
# the $ZSH_CUSTOM folder, with .zsh extension. Examples:
# - $ZSH_CUSTOM/aliases.zsh
# - $ZSH_CUSTOM/macos.zsh
# For a full list of active aliases, run alias.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# To customize prompt, run p10k configure or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

/home

# Set up the prompt

autoload -Uz promptinit
promptinit
prompt adam1

setopt histignorealldups sharehistory

# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e

# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history

# Use modern completion system
autoload -Uz compinit
compinit

zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]= r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true

zstyle ':completion:::kill::processes' list-colors '=(#b) #([0-9]#)=0=01;31'
zstyle ':completion::kill:' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments