I've just started using zsh as my shell, coming from bash. I am on a RedHat Linux Workstation build 6.4. I have all the relevent locales installed but when I move to a zsh prompt and pick any of the themes I have a PS1 that looks like this
ââ[name#host] - [~/tars] - [2013-11-05 09:50:26]
ââ[0]
I'm not sure what is causing these special characters. Another example:
name#host ~/tars » echo $PS1 1 âµ
%{$fg[$NCOLOR]%}%n%{$fg[green]%}#%m%{$reset_color%} %~ \
$(git_prompt_info)\
%{$fg[red]%}%(!.#.»)%{$reset_color%}
Is there something I'm missing that I should have installed?
Depending on the prompt theme you use you need a font which supports those characters or need to install additional fonts for your terminal, like the Powerline fonts.
Related
I am trying to set a custom prompt for GHCI on Windows, but the ANSI colours do not seem to be working.
I tried opening GHCI on CMD (and even in the new Windows Terminal app) and running
:set prompt "\ESC[101m\STX \ESC[m\STX"
which should just display 2 red spaces, but the colouring does not work. It just shows two black spaces.
It works without any problem on my linux distro, so the code should be fine?
Also, it works on Git Bash but not on the VS Code terminal, even if I set it to use Git Bash by default.
I don't even know where to look for a solution, as it could be a GHCI problem or a CMD problem or I'm just missing some package that I need on Windows?
I found a solution but it requires an extra \n after the prompt.
The following command shows it correctly.
:set prompt "\ESC[101m\STX >\ESC[m\STX\n"
One Trick that can be applied is to use a combination of \r \t characters for a fixed tab width.
:set prompt "\ESC[101m\STX >\ESC[m\STX\r\t"
I however could not find how to change the width of tab character in PowerShell or Windows Terminal.
I'm using Win10 with Ubuntu Linux installed with Bash.
I'm having trouble reading BASH multiple colors and want to switch it to monochrome color (2 colors) for easier reading.
I tried Google search and can't find the Ubuntu Bash command line for that.
If you only want to use two colors, we can add three lines to ~/.bashrc to achieve that.
We add three lines at the end of ~/.bashrc, like this:
$vi ~/.bashrc
rt LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
After add it completed, we exit this bash to flush it, then login this bash, here is my result:
Also, if you want to set other colors, we can follow this link to do it.
Here a similar case about you, please refer to it.
Update:
We can use CMD to open ubuntu bash, like this:
I have installed a Dracula Theme(https://draculatheme.com/iterm/) on my iTerm2, however, it doesn't seem to come with $PS parameters that give the exact same look for the prompt text with icons. I searched the internet to no avail...
The $PS parameters you see is a theme of Oh-My-Zsh.
Use command:zsh --version to see if you get zsh shell in your computer.
If it comes out the version, you have Zsh already.
Use command line to install Oh-My-Zsh:(You can go to the official website to geti the command line)
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Oh-My-Zsh is a tool to help you config Zsh.
Use command:chsh -s /bin/zsh to change your shell from Bash or other shells to Zsh.
Restart your terminal.
You will got Dracula Theme as you see in the picture, because it uses the default theme of Oh-My-Zsh.
You will find more themes of Oh-My-Zsh to change the $PS parameters. And you will learn how to edit the configuration files to change the $PS parameters.
I'm using CentOS 6. Since the CentOS repos have an older version of vim (7.2), I have compiled my own. However, I am having a weird issue. After running and exiting vim, I've found that my shell prompt has disappeared. Also, when I type, it does not appear in the terminal, nor does any output. What's weird is that it looks as though something is being outputted, since the cursor will move down the screen, but I can't see anything.
It must have something to do with compiling an X version, because it does not happen when I compile vim without X windows support (but I would like to have gvim, too). Here are the configuration options I supplied when compiling:
./configure --prefix=$OPT/Cellar/vim/7.4 --with-features=huge --enable-gui=auto --with-x --enable-xim
I also tried compiling without Xim. I've also tried explicitly setting --enable-gui=gtk2 (which is what gvim 7.2 from the CentOS repos uses).
I am using KDE4. The problem occurs both when running tcsh and bash. I have tried with $TERM set to both xterm and xterm-256color as well.
Additionally, running neither reset nor stty sane restores the shell to its proper behavior.
Any idea why my prompt disappears when running vim? As I missing a config flag or some other compilation issue?
I ultimately traced this down to an error in my ~/.vimrc file. I had some lines like this:
if has('gui_running')
# Gvim customization
endif
if has('gui_gtk2')
# GTK2-specific Gvim customization
endif
The second block was running every time vim loaded. Because it changed some window geometry, it ended up messing up bash; when I dropped back to bash, bash thought it only had ~53 columns to work with (and possibly some other things were messed up).
Solution: The second if block should be inside the first.
I cannot see any syntax highlighting in any language (e.g. python, c++ and sh) when I use vim within a screen session. The line numbers are in color though.
I precise that my terminal (in screen too) is able to show 256 colors schemes (I tested with the 256colors perl script found here: http://frexx.de/xterm-256-notes/ ).
How can I fix that?
OK, here is the issue/solution:
I used to call vim by using $vi, indeed:
$ which vi
alias vi='vim'
/usr/bin/vim
But:
$ screen
$ which vi
/bin/vi
I just learnt that screen doesn't load this system level alias which is tricky.
I had this problem. In my case, I was running a version of screen from brew. brew doesn't use ~/.screenrc as its startup file. So there's two solutions to this.
1) Set your term in the screenrc that brew_screen is expecting. This might be /opt/etc/screenrc. I didn't try this method, so I'm not sure.
2) Make an alias for screen that sets the term to what you want it to be. In this case, screen-256color is sufficient. I added the following line to my bash_profile, which is symlinked to my bashrc (mac problems):
alias screen='screen -T screen-256color'