Customize Prompt Color for Pure Theme? - themes

I'm currently using the Pure theme for zsh, but the default blue is really dark. Is it possible to change only the blue (i.e. I don't want to install zsh-syntax-highlighting)?

As the color is set via %F{blue} inside the theme the exact color used for blue is set in your terminal (most probably).
So to change this color you need to check how to configure those colors for your terminal.
Just as an example here is a superuser answer for "How to set color terminal for iTerm2?"

change terminal profile
open terminal
cmd + , show terminal profiles
change any [ansi colors] that you didnot like
if this is not effect, you need custom your theme
custom your theme
first find the dir
echo $ZSH_CUSTOM
second build the theme file
cd ~/.oh-my-zsh/custom
mkdir themes
mate themes/xxx.zsh-theme
third fix the ~/.zshrc file change theme:
ZSH_THEME="xxx"
fourth open your xxx.zsh-theme, u can change anything.
maybe you need copy a sample: https://github.com/robbyrussell/oh-my-zsh/tree/master/themes
about color u can get information from : https://en.wikipedia.org/wiki/ANSI_escape_code

Related

How to set terminal tabs titles in zsh, to vim filenames

I am using a oh-my-zsh shell in an Apple terminal (2.11) in full screen, and by default the name of the tabs is the name of the program being run (eg. vim).
Is there an easy way to set the title of the individual terminal tabs to the filename currently opened with vim?
The terminal window title is already set, but not visible in full screen mode. What I'm looking for is to get at a glance the title of all terminal tabs where vim is opened.
Screenshot below:
The solution seems to use vim script shared in https://stackoverflow.com/a/48975505/4756084. It sets the title dynamically based on what file is currently being viewed — which you cannot obtain by going into Terminal Preferences > Tab, and checking "Active process name" and "Arguments" (that would only display the name of the file opened when typing vim file.ext, ignoring any file opened with :e file2.txt, switches between vim panes, etc.)
(With oh-my-zsh, uncommenting DISABLE_AUTO_TITLE="true" in ~/.zshrc might help, as suggested in https://superuser.com/questions/292652/change-iterm2-window-and-tab-titles-in-zsh, although it seems optional after the step above.)

Green background on some directories [Oh My Zsh, Zsh]

I have a problem with my terminal / VS Code integrated terminal. When I'm changing directory some directories are with a green background and it's annoying. And I don't know how to disable it. I know that in .zshrc I can disable colors in ls with DISABLE_LS_COLORS="true" but this is not working with cd command.
In the default terminal, it is relatively readable, but in VS Code it is unreadable. Any help?
Add the following line to your .zshrc file
export LS_COLORS="$LS_COLORS:ow=1;34:tw=1;34:"
save the file and then run
source ~/.zshrc
You could just change it for vs code and over ride any theme by changing the settings.json file in settings --> search for workbench --> click edit in settings.json under colour customisations. This should override any theme present from any other add-ons or external terminal mods. I have not tested it before with zshrc though.
In the brackets enter something like this:
"terminal.foreground": "#839496",
"terminal.background": "#002833",
"terminal.ansiBlack": "#003541",
"terminal.ansiBlue": "#268bd2",
"terminal.ansiCyan": "#2aa198",
"terminal.ansiGreen": "#859901",
"terminal.ansiMagenta": "#d33682",
"terminal.ansiRed": "#dc322f",
"terminal.ansiWhite": "#eee8d5",
"terminal.ansiYellow": "#b58901",
"terminal.ansiBrightBlack": "#586e75",
"terminal.ansiBrightBlue": "#839496",
"terminal.ansiBrightCyan": "#93a1a1",
"terminal.ansiBrightGreen": "#586e75",
"terminal.ansiBrightMagenta": "#6c6ec6",
"terminal.ansiBrightRed": "#cb4b16",
"terminal.ansiBrightWhite": "#fdf6e3",
"terminal.ansiBrightYellow": "#657b83",
"terminalCursor.foreground": "#839496",
"terminalCursor.background": "#003541"

Set Terminal Title on Mac OSX

I am trying for days now, to set a custom Title to my terminal, I'm using bash as shell and I succeeded set a title only when a command is running with COMMAND_PROMPT.
I would like to know if there is a possibility to make this title permanent and appear when I open my terminal window.
You should be able to set that permanently from Terminal > Preferences > Profiles > Window.
Set your custom title on the Title textbox (ex. "TEST123").
You can also check/uncheck the other checkboxes here to show/hide the other elements of your title bar. For example, the "Active process name" will display bash (if bash is your login shell).
Try to uncheck them all then save that profile (Shell > Use Settings as Default) and restart your Terminal. When you open a new Terminal window, it should just show the title (and the current directory, which will get to in a moment) like this:
If you also want to get rid of the current directory, you'll have to add this to your .profile in your home directory (as mentioned on this answer):
unset PROMPT_COMMAND
When you again restart the Terminal, it should only have your custom title:
You can set the title like this :
echo -n "\033]0;${USER}#${HOST}\007"
More info here:
If you want this when you open the terminal, you can add your title to the .bachrc file
From the Terminal manual, if you look for "keyboard shortcuts" it states that you can edit a terminal title by doing:
Shift-Command-I

Change default terminal app in Visual Studio Code on Mac

I want to change the default terminal app used by Visual Studio Code for Mac. I am thinking it is part of preferences or settings json, but unsure.
Here's an example of how to make another terminal the default for VSCode, in this example I've downloaded iTerm2 and copied iTerm2 to Applications.
Code (Menu) > Preferences > User Settings
Edit settings.json "terminal.external.osxExec": "iTerm.app" and "terminal.explorerKind": "external"
Open in Terminal
iTerm is now default terminal launched from VSCode
For those that want to change the default integrated terminal NOT just the external, and add custom themes, show which git branch you are on, and whether or not files need to be staged or committed for example.
Follow these short steps:
Make sure you have these installed:
iTerm2, oh-my-zsh
Install a powerline font (I am using Menlo which is a nice looking and very popular font).
Go here and click on download
Open the file
Click on install font
(Note: without this, vscode integrated terminal will not render themes correctly)
Open the .zshrc file by running this command:
cd ~ ; code .zshrc
Change iTerm's theme to agnoster:
Press ⌘f to open search in the .zshrc file
Type ZSH_THEME
Search until you find the live code, NOT the commented out code :)
Edit the code it so it looks like ZSH_THEME="agnoster"
Save the file
Open vscode settings using shortcut:
⌘,
Inside of vscode settings, you will see two panels. On the right panel paste this:
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"
Assuming the settings were empty before, it should now look like this:
{
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"
}
Finished! Enjoy your new pimped out terminal
-(Optional customization)-
If you want your prompt to display something other than your username such as a thunder bolt, like in mine or anything you want
Open agnoster theme by runnning this command:
cd ~/.oh-my-zsh/themes/ ; code agnoster.zsh-theme
Open search by pressing:
⌘f
Paste this in search bar:
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER#%m"
To change your what your prompt displays, edit ONLY this part:
$USER#%m
DO NOT CHANGE this part:
prompt_segment black default "%(!.%{%F{yellow}%}.)
In conclusion, the code should now look something like this:
prompt_segment black default "%(!.%{%F{yellow}%}.) Insert here whatever your heart desires"
(Note: Technically you can change everything about your terminal prompt, but for the sake of keeping this short, and simple we only edited the username part)
None of these answers fully worked for me. Here is what I changed to get it to work:
Select the default shell as zsh:
CMD + SHIFT + P to open up the command palette. Then type Terminal: Select Default Shell. You can then select zsh.
Change the terminal to use iTerm
Change the font family to use Powerlevel10k
Result
I recently changed my terminal in VSCode to ozh, its just 1 step and 1 line.
Open Command Palette using View > Command Palette
( or simply Command + Shift + P )
add the following line to the user settings.
"terminal.integrated.shell.osx": "zsh"
well I know it's so late, but you could just change it by running command
Terminal: Select Default Shell
its so much easier
From visual studio code blog:
// 64-bit cmd it available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\cmd.exe"
// 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
Reference: Integrated Terminal
In vscode settings.json add:
"terminal.integrated.profiles.osx": {
"zsh": null
},
No. But you can vote for this feature here: https://visualstudio.uservoice.com/forums/293070-visual-studio-code

export woff with postscript contour | how to use Sfnttool?

To make font-face kit, I use the font-face generator by font squirrel : http://www.fontsquirrel.com/fontface/generator
But this doesn't support postscript contour and it export only woff with truetype contour. Is there a website or a programm to do it?
<-- Edit -->
A guy from Typophile told me I could use sfntly ( http://code.google.com/p/sfntly/ ) but I have absolutely no idea how to use this. Anyone knowes wehe to start with that ?
Easiest method is to download the sfnt2woff tool from http://people.mozilla.com/~jkew/woff/
Once downloaded, open Terminal.app in OS X and drag sfnt2woff to the Terminal window. (This will paste the full path of the app on the command line.) It is then a simple terminal command:
/path/to/sfnt2woff -v 1.0 /path/to/font.otf
A WOFF will be created in the same directory as the font.

Resources