]> arthur.barton.de Git - ax-zsh.git/blob - core/10_terminal/10_terminal.zshrc
Initial commit
[ax-zsh.git] / core / 10_terminal / 10_terminal.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # 10_terminal.zshrc: Initialize terminal settings
3
4 # Set terminal title
5
6 function axzsh_terminal_precmd {
7         printf '\e]1;%s\a' "$LOGNAME@$SHORT_HOST"
8 }
9
10 precmd_functions+=(axzsh_terminal_precmd)
11
12 # Set current working directory
13
14 function axzsh_terminal_cwd {
15         if [[ $TERM_PROGRAM == Apple_Terminal ]]; then
16                 local url="file://$HOSTNAME${PWD// /%20}"
17                 printf '\e]7;%s\a' "$url"
18         fi
19 }
20
21 precmd_functions+=(axzsh_terminal_cwd)
22
23 # Colors
24
25 autoload -U colors
26 colors
27
28 # Text effects (FX)
29
30 typeset -Ag fx
31 fx=(
32         reset           "\e[00m"
33         bold            "\e[01m"
34         no-bold         "\e[22m"
35         italic          "\e[03m"
36         no-italic       "\e[23m"
37         underline       "\e[04m"
38         no-underline    "\e[24m"
39         blink           "\e[05m"
40         no-blink        "\e[25m"
41         reverse         "\e[07m"
42         no-reverse      "\e[27m"
43 )