Comments (21)
Open your .zshrc
and paste this at the bottom:
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
fi
}
This makes only your username to appear. If you don't want that too, just comment out this line prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
from agnoster-zsh-theme.
My config in ~/.oh-my-zsh/themes/agnoster.zsh-theme
to random emoji.
prompt_context() {
# Custom (Random emoji)
emojis=("⚡️" "🔥" "💀" "👑" "😎" "🐸" "🐵" "🦄" "🌈" "🍻" "🚀" "💡" "🎉" "🔑" "🇹🇭" "🚦" "🌙")
RAND_EMOJI_N=$(( $RANDOM % ${#emojis[@]} + 1))
prompt_segment black default "${emojis[$RAND_EMOJI_N]} "
}
from agnoster-zsh-theme.
Simply add DEFAULT_USER=$USER
in .zshrc
from agnoster-zsh-theme.
How to set agnoster theme in termux please tell me
from agnoster-zsh-theme.
In my .zshrc I did:
# change prompt
prompt_context() {
prompt_segment $PRIMARY_FG default " 🌈 "
}
prompt_dir() {
prompt_segment blue $PRIMARY_FG ' %c '
}
:)
from agnoster-zsh-theme.
Similar to @kud, but modified my prompt to work in agnoster.
I updated the prompt_context
in ~/.oh-my-zsh/themes/agnoster.zsh-theme
(because it was being overwritten) and used the agnoster background variable (CURRENT_BG
):
prompt_context() {
prompt_segment $CURRENT_BG default " 🌈 "
}
from agnoster-zsh-theme.
In my .zshrc I did:
# change prompt prompt_context() { prompt_segment $PRIMARY_FG default " 🌈 " } prompt_dir() { prompt_segment blue $PRIMARY_FG ' %c ' }
:)
thanks for that!
from agnoster-zsh-theme.
@itsmehemant123 's solution didn't quite work for me.
I want to recommend changing this in your theme, rather than your .zshrc
like @TheLandoCal , I updated the prompt_context
in ~/.oh-my-zsh/themes/agnoster.zsh-theme
.
For me, I just wanted to show my username, without my '@ hostname'.
Original agnoster.zsh-theme
:
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
fi
}
I just removed @%m
from line 92.
Updated agnoster.zsh-theme
:
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)%n"
fi
}
from agnoster-zsh-theme.
In ~/.oh-my-zsh/themes/agnoster.zsh-theme
change the prompt_context
function to not do anything. Like this:
prompt_context() {}
from agnoster-zsh-theme.
This PR will help: #40
from agnoster-zsh-theme.
@itsmehemant123 ty so much
from agnoster-zsh-theme.
My config in
~/.oh-my-zsh/themes/agnoster.zsh-theme
to random emoji.prompt_context() { # Custom (Random emoji) emojis=("⚡️" "🔥" "💀" "👑" "😎" "🐸" "🐵" "🦄" "🌈" "🍻" "🚀" "💡" "🎉" "🔑" "🇹🇭" "🚦" "🌙") RAND_EMOJI_N=$(( $RANDOM % ${#emojis[@]} + 1)) prompt_segment black default "${emojis[$RAND_EMOJI_N]} " }
woooo tankyou bro
from agnoster-zsh-theme.
May I ask why the DEFAULT_USER
query is there at all?
Perhaps I miss something, but it seems like a double-check, when SSH_CLIENT
is already being queried. It's an extra step required when working on different machines with different users, or when sharing or adapting dotfiles. It potentially also leads to disclosure of people's local usernames in their public dotfiles.
from agnoster-zsh-theme.
May I ask why the DEFAULT_USER query is there at all?
I think this is in case you're su
-ing or logging in as an unusual user on your local machine, or you have a typical "regular" account you use on multiple machines.
from agnoster-zsh-theme.
wow, nothing helped. I'm using bira
theme.
from agnoster-zsh-theme.
Iam using oh my zsh and ur theme is listed there how can I install ur theme, pls tell me
from agnoster-zsh-theme.
On MacOS 10.15 Catalina in 2021 year
Open the file /private/etc/zshrc in a text editor
Locate the comment: # Default prompt
Modify the line that looks like this: PS1="%n@%m~ %& # "
Save the file. You will be prompted to enter a password to save it.
Load a new Terminal window.
For example, you can:
Remove "%n@%m" to get rid of both the username and computer name
Remove "%n" to get rid of the user name
Remove "%m" to get rid of the machine name
Source https://stackoverflow.com/a/59944342/10991361
from agnoster-zsh-theme.
How to hide the owner and group names when doing listings (ls -la) for instance?
from agnoster-zsh-theme.
Make sure you add this line to the ~/.zshrc
file:
export DEFAULT_USER="$(whoami)"
from agnoster-zsh-theme.
Thanks! The last thing would be how to hide or change the user name on the top of the Terminal window?
from agnoster-zsh-theme.
Thanks! The last thing would be how to hide or change the user name on the top of the Terminal window?
In order to achieve what you want, in the ~/.zshrc
file:
First uncomment DISABLE_AUTO_TITLE="true"
and after
add this line precmd () { print -Pn "\e]2; %~\a" } # title bar prompt
at the end of the file:
Source https://superuser.com/questions/79972/set-the-title-of-the-terminal-window-to-the-current-directory
from agnoster-zsh-theme.
Related Issues (20)
- Some identification characters cannot be displayed HOT 3
- Display Problem on Ubuntu-18.04
- no display with shell HOT 1
- [help] Change Default path to minified version? HOT 1
- Broken prompt after another oh-my-zsh upgrade HOT 6
- display blanks from webstorm terminal HOT 2
- How can I shorten the prompt? HOT 2
- broken auto complete HOT 1
- An Empty Space Between the Segments on Windows Terminal?
- inside .git folders Agnoster produces "fatal: this operation must be run in a work tree"
- Problem with characters HOT 8
- Anaconda/Miniconda Python Virtual Environment displaying error
- warp Terminal is showing $SEGMENT_SEPARATOR on black when is in a git repo
- Agnoster Prompt triangles look separated HOT 3
- Font issues HOT 2
- Full prompt in same color !! HOT 1
- Please add a license file
- prompt no coloring HOT 1
- Issue with typed text not showing up in cmder
- messed up char on shell prompt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agnoster-zsh-theme.