Skip to content

Commit

Permalink
Merge branch 'ohmyzsh:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvisClaros authored Dec 14, 2023
2 parents 88caf67 + 48ccc7b commit cfe3f0a
Show file tree
Hide file tree
Showing 112 changed files with 2,178 additions and 1,016 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
workflow_dispatch: {}
push:
paths:
- tools/install.sh
- .github/workflows/installer
- .github/workflows/installer.yml
- 'tools/install.sh'
- '.github/workflows/installer/**'
- '.github/workflows/installer.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -17,6 +17,7 @@ permissions:
jobs:
test:
name: Test installer
if: github.repository == 'ohmyzsh/ohmyzsh'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
cp tools/install.sh .github/workflows/installer/install.sh
cd .github/workflows/installer
vc link --yes -t ${{ secrets.VERCEL_TOKEN }}
vc deploy --prod -t ${{ secrets.VERCEL_TOKEN }}
vc deploy --prod -t "$VERCEL_TOKEN"
11 changes: 10 additions & 1 deletion .github/workflows/installer/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"headers": [
{
"source": "/((?!favicon.ico).*)",
"headers": [{ "key": "Content-Type", "value": "text/plain" }]
"headers": [
{
"key": "Content-Type",
"value": "text/plain"
},
{
"key": "Content-Disposition",
"value": "inline; filename=\"install.sh\""
}
]
}
],
"rewrites": [
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ permissions:
jobs:
tests:
name: Run tests
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
if: github.repository == 'ohmyzsh/ohmyzsh'
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Set up git repository
uses: actions/checkout@v3
- name: Install zsh
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install zsh
- name: Check syntax
run: |
Expand Down
81 changes: 53 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,42 @@ Finally, you'll begin to get the sort of attention that you have always felt you
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and join us on [Discord](https://discord.gg/ohmyzsh).

[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ohmyzsh?label=%40ohmyzsh&logo=x&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/111169632522566717?label=%40ohmyzsh&domain=https%3A%2F%2Fmstdn.social&logo=mastodon&style=flat)](https://mstdn.social/@ohmyzsh)
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh)
[![Gitpod ready](https://img.shields.io/badge/Gitpod-ready-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh)
[![huntr.dev](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh)

<details>
<summary>Table of Contents</summary>

- [Getting Started](#getting-started)
- [Operating System Compatibility](#operating-system-compatibility)
- [Prerequisites](#prerequisites)
- [Basic Installation](#basic-installation)
- [Manual inspection](#manual-inspection)
- [Manual Inspection](#manual-inspection)
- [Using Oh My Zsh](#using-oh-my-zsh)
- [Plugins](#plugins)
- [Enabling Plugins](#enabling-plugins)
- [Using Plugins](#using-plugins)
- [Themes](#themes)
- [Selecting a Theme](#selecting-a-theme)
- [Selecting A Theme](#selecting-a-theme)
- [FAQ](#faq)
- [Advanced Topics](#advanced-topics)
- [Advanced Installation](#advanced-installation)
- [Custom Directory](#custom-directory)
- [Unattended install](#unattended-install)
- [Installing from a forked repository](#installing-from-a-forked-repository)
- [Unattended Install](#unattended-install)
- [Installing From A Forked Repository](#installing-from-a-forked-repository)
- [Manual Installation](#manual-installation)
- [Installation Problems](#installation-problems)
- [Custom Plugins and Themes](#custom-plugins-and-themes)
- [Enable GNU ls in macOS and freeBSD systems](#enable-gnu-ls)
- [Skip aliases](#skip-aliases)
- [Custom Plugins And Themes](#custom-plugins-and-themes)
- [Enable GNU ls In macOS And freeBSD Systems](#enable-gnu-ls-in-macos-and-freebsd-systems)
- [Skip Aliases](#skip-aliases)
- [Getting Updates](#getting-updates)
- [Updates verbosity](#updates-verbosity)
- [Updates Verbosity](#updates-verbosity)
- [Manual Updates](#manual-updates)
- [Uninstalling Oh My Zsh](#uninstalling-oh-my-zsh)
- [How do I contribute to Oh My Zsh?](#how-do-i-contribute-to-oh-my-zsh)
- [Do NOT send us themes](#do-not-send-us-themes)
- [How Do I Contribute To Oh My Zsh?](#how-do-i-contribute-to-oh-my-zsh)
- [Do Not Send Us Themes](#do-not-send-us-themes)
- [Contributors](#contributors)
- [Follow Us](#follow-us)
- [Merchandise](#merchandise)
Expand All @@ -58,9 +59,21 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi

## Getting Started

### Operating System Compatibility

| O/S | Status |
| :------------- | :-----: |
| Android ||
| freeBSD ||
| LCARS | 🛸 |
| Linux ||
| macOS ||
| OS/2 Warp ||
| Windows (WSL2) ||


### Prerequisites

- A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL2 is preferred, but cygwin or msys also mostly work.
- [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
- `curl` or `wget` should be installed
- `git` should be installed (recommended v2.4.11 or higher)
Expand All @@ -75,9 +88,17 @@ Oh My Zsh is installed by running one of the following commands in your terminal
| **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
| **fetch** | `sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |

Alternatively, the installer is also mirrored outside GitHub. Using this URL instead may be required if you're in a country like India or China, that blocks `raw.githubusercontent.com`:

| Method | Command |
| :-------- | :------------------------------------------------------------------------------------------------ |
| **curl** | `sh -c "$(curl -fsSL https://install.ohmyz.sh/)"` |
| **wget** | `sh -c "$(wget -O- https://install.ohmyz.sh/)"` |
| **fetch** | `sh -c "$(fetch -o - https://install.ohmyz.sh/)"` |

_Note that any previous `.zshrc` will be renamed to `.zshrc.pre-oh-my-zsh`. After installation, you can move the configuration you want to preserve into the new `.zshrc`._

#### Manual inspection
#### Manual Inspection

It's a good idea to inspect the install script from projects you don't yet know. You can do
that by downloading the install script first, looking through it so everything looks normal,
Expand All @@ -88,6 +109,8 @@ wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh
```

If the above URL times out or otherwise fails, you may have to substitute the URL for `https://install.ohmyz.sh` to be able to get the script.

## Using Oh My Zsh

### Plugins
Expand Down Expand Up @@ -126,7 +149,7 @@ Each built-in plugin includes a **README**, documenting it. This README should s

We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred and fifty themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!). Check them out!

#### Selecting a Theme
#### Selecting A Theme

_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right one (for him)._

Expand Down Expand Up @@ -197,7 +220,7 @@ like this:
ZSH="$HOME/.dotfiles/oh-my-zsh" sh install.sh
```

#### Unattended install
#### Unattended Install

If you're running the Oh My Zsh install script as part of an automated install, you can pass the `--unattended`
flag to the `install.sh` script. This will have the effect of not trying to change
Expand All @@ -207,7 +230,9 @@ the default shell, and it also won't run `zsh` when the installation has finishe
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
```

#### Installing from a forked repository
If you're in China, India, or another country that blocks `raw.githubusercontent.com`, you may have to substitute the URL for `https://install.ohmyz.sh` for it to install.

#### Installing From A Forked Repository

The install script also accepts these variables to allow installation of a different repository:

Expand All @@ -232,35 +257,35 @@ REPO=apjanke/oh-my-zsh BRANCH=edge sh install.sh

#### Manual Installation

##### 1. Clone the repository <!-- omit in toc -->
##### 1. Clone The Repository <!-- omit in toc -->

```sh
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
```

##### 2. _Optionally_, backup your existing `~/.zshrc` file <!-- omit in toc -->
##### 2. _Optionally_, Backup Your Existing `~/.zshrc` File <!-- omit in toc -->

```sh
cp ~/.zshrc ~/.zshrc.orig
```

##### 3. Create a new zsh configuration file <!-- omit in toc -->
##### 3. Create A New Zsh Configuration File <!-- omit in toc -->

You can create a new zsh config file by copying the template that we have included for you.

```sh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
```

##### 4. Change your default shell <!-- omit in toc -->
##### 4. Change Your Default Shell <!-- omit in toc -->

```sh
chsh -s $(which zsh)
```

You must log out from your user session and log back in to see this change.

##### 5. Initialize your new zsh configuration <!-- omit in toc -->
##### 5. Initialize Your New Zsh Configuration <!-- omit in toc -->

Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.

Expand All @@ -271,15 +296,15 @@ If you have any hiccups installing, here are a few common fixes.
- You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`.
- If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`.

### Custom Plugins and Themes
### Custom Plugins And Themes

If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory.

If you have many functions that go well together, you can put them as a `XYZ.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin.

If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.

### Enable GNU ls in macOS and freeBSD systems
### Enable GNU ls In macOS And freeBSD Systems

<a name="enable-gnu-ls"></a>

Expand All @@ -293,7 +318,7 @@ zstyle ':omz:lib:theme-and-appearance' gnu-ls yes

_Note: this is not compatible with `DISABLE_LS_COLORS=true`_

### Skip aliases
### Skip Aliases

<a name="remove-directories-aliases"></a>

Expand Down Expand Up @@ -376,7 +401,7 @@ zstyle ':omz:update' frequency 7
zstyle ':omz:update' frequency 0
```

### Updates verbosity
### Updates Verbosity

You can also limit the update verbosity with the following settings:

Expand Down Expand Up @@ -404,7 +429,7 @@ Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy b

If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration.

## How do I contribute to Oh My Zsh?
## How Do I Contribute To Oh My Zsh?

Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md).

Expand All @@ -414,7 +439,7 @@ We also need people to test out pull requests. So take a look through [the open

See [Contributing](CONTRIBUTING.md) for more details.

### Do NOT send us themes
### Do Not Send Us Themes

We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) wiki page.

Expand Down
5 changes: 2 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ In the near future we will introduce versioning, so expect this section to chang

**Do not submit an issue or pull request**: this might reveal the vulnerability.

Instead, you should email the maintainers directly at: [**[email protected]**](mailto:[email protected]).
Instead, you should email the maintainers directly at: [**[email protected]**](mailto:[email protected]),
or using the link to [privately report a vulnerability with GitHub](https://github.com/ohmyzsh/ohmyzsh/security/advisories/new).

We will deal with the vulnerability privately and submit a patch as soon as possible.

You can also submit your vulnerability report to [huntr.dev](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh) and see if you can get a bounty reward.
10 changes: 5 additions & 5 deletions lib/clipboard.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ function detect-clipboard() {
fi
}

# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set,
# which is not really an error. If the user calls them, they will attempt to redetect
# (for example, perhaps the user has now installed xclip) and then either print an error
# or proceed successfully.
detect-clipboard || true
function clipcopy clippaste {
unfunction clipcopy clippaste
detect-clipboard || true # let one retry
"$0" "$@"
}
5 changes: 5 additions & 0 deletions lib/functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ function omz_urlencode() {
fi

# Use LC_CTYPE=C to process text byte-by-byte
# Note that this doesn't work in Termux, as it only has UTF-8 locale.
# Characters will be processed as UTF-8, which is fine for URLs.
local i byte ord LC_ALL=C
export LC_ALL
local reserved=';/?:@&=+$,'
Expand All @@ -206,6 +208,9 @@ function omz_urlencode() {
else
if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
url_str+="+"
elif [[ "$PREFIX" = *com.termux* ]]; then
# Termux does not have non-UTF8 locales, so just send the UTF-8 character directly
url_str+="$byte"
else
ord=$(( [##16] #byte ))
url_str+="%$ord"
Expand Down
9 changes: 7 additions & 2 deletions lib/misc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ setopt multios # enable redirect to multiple streams: echo >file1 >
setopt long_list_jobs # show long list format job notifications
setopt interactivecomments # recognize comments

env_default 'PAGER' 'less'
env_default 'LESS' '-R'
# define pager dependant on what is available (less or more)
if (( ${+commands[less]} )); then
env_default 'PAGER' 'less'
env_default 'LESS' '-R'
elif (( ${+commands[more]} )); then
env_default 'PAGER' 'more'
fi

## super user alias
alias _='sudo '
Expand Down
4 changes: 2 additions & 2 deletions lib/termsupport.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function title {
: ${2=$1}

case "$TERM" in
cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot|contour*)
cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot*|contour*)
print -Pn "\e]2;${2:q}\a" # set window name
print -Pn "\e]1;${1:q}\a" # set tab name
;;
Expand Down Expand Up @@ -151,7 +151,7 @@ function omz_termsupport_cwd {
URL_PATH="$(omz_urlencode -P $PWD)" || return 1

# Konsole errors if the HOST is provided
[[ -z "$KONSOLE_VERSION" ]] || URL_HOST=""
[[ -z "$KONSOLE_PROFILE_NAME" && -z "$KONSOLE_DBUS_SESSION" ]] || URL_HOST=""

# common control sequence (OSC 7) to set current host and path
printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}"
Expand Down
Loading

0 comments on commit cfe3f0a

Please sign in to comment.