1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-11 00:10:08 +00:00
Commit graph

749 commits

Author SHA1 Message Date
Marc Cornellà
428f815169
fix(lib): %-quote git prompt functions 2021-12-13 11:26:55 +01:00
Marc Cornellà
f0f792fa6b
feat(cli): add omz version command 2021-11-30 10:13:23 +01:00
Paul Scott
0314604384
fix(lib): don't error if INSIDE_EMACS is not defined (#10443) 2021-11-25 23:55:21 +01:00
Marc Cornellà
a263cdac9c
fix(lib): fix potential command injection in title and spectrum functions
The `title` function unsafely prints its input without sanitization, which if used
with custom user code that calls it, it could trigger command injection.

The `spectrum_ls` and `spectrum_bls` could similarly be exploited if a variable is
changed in the user's shell environment with a carefully crafted value. This is
highly unlikely to occur (and if possible, other methods would be used instead),
but with this change the exploit of these two functions is now impossible.
2021-11-11 22:45:11 +01:00
Marc Cornellà
6cb41b70a6
fix(lib): fix omz_urldecode unsafe eval bug
The `omz_urldecode` function uses an eval to decode the input which can be
exploited to inject commands. This is used only in the svn plugin and it
requires a complex process to exploit, so it is highly unlikely to have been
used by an attacker.
2021-11-11 22:44:18 +01:00
Marc Cornellà
1d166eaaa1
fix(cli): avoid git -C for compatibility with git < v1.8.5 (#10404) 2021-11-10 11:35:17 +01:00
Marc Cornellà
9a11b34101
fix(cli): fix check for completion files in omz plugin load 2021-11-09 12:03:59 +01:00
Kevin Burke
e86c6f5e7f
style: use -n flag in head and tail commands (#10391)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-11-09 09:04:10 +01:00
Richard Mitchell
bf88ff3f90
fix(lib): fix 1 alias to cd to directory 1 in stack (#10370) 2021-11-02 12:05:37 +01:00
Sina Tak Tehrani
1e5e834e0f
fix(cli): exit omz update with correct error code (#10342) 2021-10-25 20:28:22 +02:00
michael-yuji
f82aa81931
fix(lib): fix diff --color argument check for BSD systems (#10269) 2021-10-10 19:15:24 +02:00
Pooya Vahidi
07cdd7a539
fix(lib): fix status exit code check in git_prompt_status (#10275) 2021-10-09 12:02:49 +02:00
Marc Cornellà
b621eee21f
fix(cli): fix zsh array syntax for szh 5.0.2 2021-10-05 11:58:39 +02:00
Monson Shao
be4a952972
feat(cli)!: add omz reload command and deprecate zsh_reload plugin (#9078)
BREAKING CHANGE: the `zsh_reload` plugin is deprecated. Instead of using its `src`
function, use `omz reload` or `exec zsh` to reload zsh after making changes to
your `.zshrc` file.

Closes #9078
2021-10-04 16:24:05 +02:00
Marc Cornellà
3c209b00d6
feat(cli): show current theme in omz theme list
Fixes #9540
2021-09-30 15:45:12 +02:00
Marc Cornellà
5f99eb5afd
fix(cli): get branch and tags from OMZ folder in omz changelog completion 2021-09-30 10:18:53 +02:00
Celestino Gomes
c7a55086e1
feat(lib): don't correct su command arguments (#10214) 2021-09-29 18:07:25 +02:00
Marc Cornellà
54e3e8ef54
fix(lib): fix automatic title abort inside Emacs (#10124)
Closes #10124

Co-authored-by: Paul Schorfheide <pschorf2@gmail.com>
Co-authored-by: Alastair Rankine <alastair@girtby.net>
2021-09-29 17:19:25 +02:00
Simon Rogers
16de514047
feat(lib): allow setting custom completion dots sequence (#9424)
Closes #9424
Closes #9703

Co-authored-by: mortezadadgar <mortezadadgar97@gmail.com>
Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-09-22 11:30:07 +02:00
Marc Cornellà
cbb534267a
feat(cli): add theme set subcommand to change theme in .zshrc
Fixes #9087
2021-08-18 16:58:36 +02:00
Marc Cornellà
8dedf26294
style(cli): print usage messages to stderr 2021-08-18 12:50:22 +02:00
Marc Cornellà
7a4f4ad91e
fix(lib): fix clipboard copy on Termux 2021-08-17 17:38:31 +02:00
Marc Cornellà
bc7ce982dd
style(cli): fill rows in column output in theme and plugin list commands 2021-08-17 12:53:09 +02:00
Marc Cornellà
bf888680ea
refactor(cli): extract substitution awk script in plugin disable 2021-08-17 12:44:53 +02:00
Marc Cornellà
708bbe12c5
fix(cli): fix multiple errors in plugin disable/enable 2021-08-17 12:31:37 +02:00
pollyduan
4455c13e06
feat(cli): add subcommands for plugin enable and disable (#9869)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-08-17 12:10:54 +02:00
James Eapen
6e4c9df4a4
feat(cli): add plugin load subcommand (#9872)
Fixes #9672

Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-08-13 12:33:30 +02:00
Marc Cornellà
7eeb1e193d
refactor(lib): refactor take functions 2021-08-10 21:09:21 +02:00
Marc Cornellà
c249288151
feat(lib): add mkcd as equivalent to takedir (#9749)
Fixes #9749
2021-08-10 21:06:46 +02:00
Marc Cornellà
e32d4b1e19
fix(lib): remove kubectx stub prompt function from lib
Fixes #9974
2021-06-17 18:54:52 +02:00
Stanisław Szydło
5152d381bb
feat(kubectx): adding a new plugin for 'kubectx' (#6114)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
Co-authored-by: Robby Russell <robby@planetargon.com>
2021-06-13 08:23:13 -07:00
Mitchel Humpherys
f68d65d32a
feat(take): add support to `take' for taking remote urls (#2029)
Download, extract, and cd into the resulting directory.

Co-authored-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2021-06-11 21:09:08 -07:00
Marc Cornellà
02d07f3e3d
fix: use $USERNAME guaranteed to always be defined in zsh
Fixes #9701
2021-03-25 12:08:00 +01:00
Vlad Korolev
0ab87c26c1
fix(terraform): use faster method to get workspace (#9709)
Also add tf_prompt_info to the list of prompt functions so theme writers are aware of it
2021-03-08 10:46:42 +01:00
Cai Cooper
6fbad5bf72
fix(update): don't error on upgrade no-op (#9685)
* Don't error on upgrade no-op

No error code is required for a non failure scenario.

* Manually check whether changes were pulled in `omz update`

Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-03-01 08:17:54 +01:00
Marc Cornellà
8b37f817c2 fix(lib): use -N syntax in head and tail to support Solaris (#6391)
Closes #6391

Co-authored-by: Sergey Mashkov <cy6erGn0m@gmail.com>
2021-01-16 18:59:24 +01:00
Kyle Gerard Felker
c9bf8b4a84
fix(lib): update Emacs terminal detection in title function (#9577)
Environment variable EMACS was replaced by INSIDE_EMACS
2021-01-07 20:55:18 +01:00
Marc Cornellà
6b57839292 fix(CLI): show symlinked themes in omz theme list 2021-01-05 19:09:57 +01:00
Fernando Crespo
9e5f280f87
feat(CLI): add plugin info subcommand (#9452)
Co-authored-by: Fernando Crespo <fxcrespo@iMac-44054.local>
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2021-01-03 13:55:57 +01:00
Seamile
88ffc2f666
fix(lib): mark changes as MODIFIED on 'MM' in git_prompt_status (#9552)
In the output of `git status -sb`, 'MM' indicates there are both added and modified changes.
This change marks that case as MODIFIED instead of ADDED.
2021-01-02 11:57:06 +01:00
Marc Cornellà
0f6836701d fix(CLI): properly get zsh command in omz update (#9558)
Zsh versions older than 5.3 don't have ZSH_ARGZERO, so use an alternative
method to get the zsh command.

Fixes #9558
2020-12-31 23:20:24 +01:00
Marc Cornellà
28265812f8 chore!: notify breaking change in git_prompt_info
BREAKING CHANGE: the git config option to skip running `git_prompt_info` has changed from `oh-my-zsh.hide-status` to `oh-my-zsh.hide-info` (#9188).
2020-12-10 20:48:40 +01:00
Bruno Borges
2f39c68ab0
feat(lib): show upstream branch in git_prompt_info (#9188)
Show the remote branch the local branch is tracking if `ZSH_THEME_GIT_SHOW_UPSTREAM`
is set, like so: `ZSH_THEME_GIT_SHOW_UPSTREAM=1`.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-12-10 20:44:08 +01:00
Marc Cornellà
4b7dba5b75 feat(lib)!: soft-deprecate upgrade_oh_my_zsh function for everybody
BREAKING CHANGE: the `upgrade_oh_my_zsh` function now calls `omz update` directly.
2020-12-07 20:58:12 +01:00
Marc Cornellà
5a888ff4ac fix(updater): don't show changelog when running unattended update (#9495)
Fixes #9495
2020-12-07 20:58:12 +01:00
Marc Cornellà
1aa2b18e29 feat(CLI): add --unattended flag to omz update to not reload zsh (#9187) 2020-12-04 12:34:01 +01:00
Marc Cornellà
7712da89ee feat(CLI): add omz changelog command 2020-11-30 15:48:46 +01:00
Marc Cornellà
e093a4cf62 fix(updater): correctly restart the zsh session when the update pulled changes 2020-11-30 15:48:46 +01:00
Marc Cornellà
889cd7acf3 refactor(updater): switch to Zsh execution and fix git remote detection logic 2020-11-30 15:48:46 +01:00
Marc Cornellà
a3e0f4f2af fix(lib): make opts local in omz_urlencode to fix scoping bug
Fixes error message when using zplug, due to $opts having been declared
as an associative array:

  omz_urlencode:2: bad set of key/value pairs for associative array

Fixes #9429
2020-11-09 18:33:59 +01:00
Marc Cornellà
28ed2880c7 Revert "lib: remove share_history"
This reverts commit 2376022890.

Fixes #9430
2020-11-09 12:00:15 +01:00
Marc Cornellà
bad9ee0004 lib: delete zsh session history list
NOTE: it still lives somewhere in the current zsh process. Run `fc -P` to
restore it.
2020-10-27 10:33:21 +01:00
Marc Cornellà
3f42700c0d Revert "lib: treat _ and - as part of a word"
This reverts commit 50dc4ab357.

The community has spoken:
- https://github.com/ohmyzsh/ohmyzsh/issues/9367
- https://github.com/ohmyzsh/ohmyzsh/issues/8743

Fixes #9367
2020-10-21 16:02:34 +02:00
Marc Cornellà
f9f45ca222 lib: follow symlinked plugins in plugin list CLI command
See https://github.com/ohmyzsh/ohmyzsh/issues/9087#issuecomment-712460275
2020-10-20 15:57:11 +02:00
Marc Cornellà
7525b1d533 lib: allow bare output in theme and plugins list command 2020-10-18 21:25:03 +02:00
Marc Cornellà
902954d1cc lib: use column to format plugin and theme list CLI commands 2020-10-18 21:24:48 +02:00
Marc Cornellà
6e7b861675 lib: fix regex bug in git_prompt_status
Fixes #9326
2020-10-10 19:14:30 +02:00
Marc Cornellà
2376022890 lib: remove share_history
Related: #2537, #9324
2020-10-10 12:38:17 +02:00
Marc Cornellà
75ae0e905f lib: fix omz help and reword 2020-10-10 12:12:22 +02:00
Marc Cornellà
982d010be5 lib: fix fmt removing ESC characters in theme and plugin list CLI commands 2020-10-10 11:47:09 +02:00
Marc Cornellà
d8cb670235 nvm: simplify nvm.sh and bash completion loading 2020-10-09 17:21:03 +02:00
Andrew Janke
ef44416df2 nvm: use nvm current in nvm_prompt_info and look in alternate install locations
This makes it work regardless of where nvm is loaded from. And it uses nvm's
version strings, which distinguish the "system" and "none" NVM environments,
instead of reporting the specific version of the system node.js or erroring,
respectively.

Fixes #4336
Closes #4338
2020-10-09 17:21:03 +02:00
Marc Cornellà
fc6c9ca4b4 lib: fix formatting in omz pr clean CLI command 2020-10-09 15:03:03 +02:00
Marc Cornellà
1bb402190d lib: add plugin and theme subcommands and fix omz pr clean
- Add plugin and theme subcommand

  Fixes #8961

- Add confirmation prompt to `omz pr clean` command

- Correct behavior on invalid answers on confirmation prompts

  If an invalid option is supplied, don't proceed with the potentially
  destructive action.

Co-authored-by: Rishabh Bohra <rishabhbohra01@gmail.com>
2020-10-09 13:55:56 +02:00
Marc Cornellà
865f6572d5 Fix performance drop of iterating over lines and other stuff
- Fix 'STASHED' key and unsupported syntax in 5.0.2
- Optimise `if` statement to make it more idiomatic.
2020-10-09 13:44:50 +02:00
Billy Conn
45a954cb0f git_prompt_status now uses hash lookups instead of multiple greps 2020-10-09 13:24:37 +02:00
Michał Dębski
297238b739 lib: hide git_prompt_status when hide-status is set
Closes #4912
Closes #5137
Closes #8071
2020-10-09 13:14:44 +02:00
Michele Bologna
58ff4e1d2e
lib: follow standards in window title (#9320)
In Ubuntu and Debian, in scp, and in rsync the prompt is by default specified as in

  user@hostname:/path/to/directory

while the previous title in ohmyzsh was

  user@hostname: /path/to/directory
2020-10-08 19:20:47 +02:00
Marc Cornellà
274df9dc29 lib: support simple terminal in title function
Fixes #9295
2020-09-29 18:34:35 +02:00
Marc Cornellà
4ec055b890 lib: support alacritty $TERM in title function 2020-09-28 22:25:10 +02:00
Marc Cornellà
765966606d lib: correct :q syntax in title function for clarity 2020-09-27 14:15:50 +02:00
Marc Cornellà
caff704f41 lib: clean up zsh_stats function 2020-09-26 12:17:12 +02:00
Marc Cornellà
50dc4ab357 lib: treat _ and - as part of a word
Fixes #8743
2020-09-04 21:54:05 +02:00
Marc Cornellà
89400f156a Remove zsh session restart on omz update and upgrade_oh_my_zsh 2020-08-18 19:51:19 +02:00
Marc Cornellà
7deda85f8c Fix upgrade_oh_my_zsh function deprecation 2020-08-17 22:11:02 +02:00
Marc Cornellà
079e7bb5e0 lib: remove CTRL-Backspace key binding altogether
It conflicts with normal Backspace behavior. Fixes #9155
2020-08-06 08:55:29 +02:00
Marc Cornellà
39c0073225 lib: remove CTRL-Backspace binding for vi keymaps 2020-08-05 14:34:14 +02:00
Dario Vladović
3935ccce64
cli: add update command (#9094)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-08-04 17:48:29 +02:00
Marc Cornellà
cf347ef3e4 lib: bind to all keymaps when COMPLETION_WAITING_DOTS is set
Fixes #9050
2020-08-04 17:30:07 +02:00
Marc Cornellà
e04564d528 lib: add CTRL-backspace and CTRL-delete to delete whole words
Fixes #7609
Closes #8191

Co-authored-by: Michal Grňo <m93a.cz@gmail.com>
2020-08-04 17:16:54 +02:00
Marc Cornellà
ec70c0c393 lib: bind keys to viins and vicmd keymaps and clean up file
Fixes #8468
2020-08-04 17:16:19 +02:00
Marc Cornellà
f6bc949c05 lib: substitute COMPLETION_WAITING_DOTS for ellipsis
Closes #8342
2020-08-02 20:49:26 +02:00
Marc Cornellà
9521837240 lib: support mlterm-256color
Co-authored-by: Peter J. Schroeder <peterjschroeder@gmail.com>
2020-07-23 12:55:22 +02:00
Robert Estelle
1c58a746af
lib: safety fix and speed-ups for git.zsh prompt functions (#7804) 2020-07-06 17:31:40 +02:00
Marc Cornellà
d0d01c0bbf lib: prefix diff call with command to bypass diff aliases
See https://github.com/ohmyzsh/ohmyzsh/pull/8807#issuecomment-652697704
2020-07-06 17:17:40 +02:00
Marc Cornellà
a15f0f0e9f cli: beauty touches on 'omz pr test' command 2020-07-03 19:05:40 +02:00
Monson Shao
62648d71bb
lib: enable diff color (#8807) 2020-07-01 20:51:13 +02:00
Patrick Moore
e606ac7051
Handle unset variables in various parts of the codebase (#8944)
DISABLE_UNTRACKED_FILES_DIRTY, DISABLE_AUTO_TITLE, GIT_STATUS_IGNORE_SUBMODULES are not set
Handle these variables not being set with conditional access.

If the user has set -u option to report attempts to use undeclared / unassigned variable, accessing the variables needs to be conditional.
2020-06-30 18:54:27 +02:00
joshuashaffer
b706a91917
core: add title support for mlterm (#8303) 2020-06-19 23:16:31 +02:00
Marco Trevisan
ed4e317bbb
lib: don't override bigger HISTSIZE and SAVEHIST values (#8993)
oh-my-zsh Changes the HISTSIZE and SAVEHIST values to fixed sizes,
however if a bigger value is set in ~/.zshrc, it will override it,
potentially causing the user history to be deleted.

So, only set these values if no other is set and if it is lower than the
default ones.
2020-06-03 19:34:57 +02:00
Benoit GALATI
fcd0747bc1
core: remove inc_append_history option (#8048) 2020-05-21 18:29:00 +02:00
Marc Cornellà
cfdd3c8dd8 Revert "core: enable hist_reduce_blanks"
This reverts commit cbd6fbe7a7.

Fixes #8949
2020-05-20 14:02:42 +02:00
Jacob Menke
582c8cb291
Prefix cd calls with builtin (#8937) 2020-05-20 11:30:11 +02:00
Marc Cornellà
cbd6fbe7a7 core: enable hist_reduce_blanks
Fixes #8722
2020-05-16 17:18:20 +02:00
Marc Cornellà
da8c19a076 core: fix zstyle definition of use-cache 2020-05-11 12:11:02 +02:00
Marc Cornellà
173d4ca68f core: move core folder to lib, for now 2020-05-01 19:15:14 +02:00
Marc Cornellà
0caae9082a lib: speed up slow parts of the lib files; other small fixes 2020-04-05 21:37:45 +02:00
Marc Cornellà
2eb3e9d57c
lib: support konsole* $TERM in title function (#8035) 2020-03-05 17:26:16 +01:00
Marc Cornellà
b9d5ee7913
lib: automatic title: replace fg with description from jobs (#7982)
* Automatic title: Replace fg with description from jobs

* Avoid error messages when there is no job

* Use $jobstates and $jobtexts to look for jobs

`jobs %string` doesn't work correctly when run inside `$()`. `$jobstates` and
`$jobtexts` is available in the current shell process, so even though we need
to replicate a bit more logic, every type of `fg` invocation works correctly.

* lib: clean up termsupport.zsh

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-03-03 20:21:29 +01:00
Marc Cornellà
02d1253809
lib: clean up termsupport.zsh 2020-03-03 20:17:01 +01:00
Marc Cornellà
d7825313cc
Use $jobstates and $jobtexts to look for jobs
`jobs %string` doesn't work correctly when run inside `$()`. `$jobstates` and
`$jobtexts` is available in the current shell process, so even though we need
to replicate a bit more logic, every type of `fg` invocation works correctly.
2020-03-03 20:10:43 +01:00
Marek Dědič
bbe54e4e60
lib: use command to run rm in upgrade function (#8696) 2020-03-03 13:46:06 +01:00
Marc Cornellà
d3dfc13716 lib: use grep-alias cache only if ZSH_CACHE_DIR is writable
Fixes #8693
2020-03-02 12:35:58 +01:00
Marc Cornellà
dc190d872a Refactor grep.zsh file
- Move grep-alias path to variable.
- Use <<< "" instead of piped echo to check grep flags.
- Remove check for --color only since it's the same release as --exclude.
2020-03-01 20:40:27 +01:00
Marc Cornellà
8d814fdff6 Fast algorithm to determine grep alias flags
This version tries whether grep supports all the flags together
and progressively checks older flags if the grep test fails.
This means only one grep call if all flags are supported, and
one additional call for every flag that's not supported, up to
a maximum of 3 calls.
2020-03-01 14:05:01 +01:00
mattmc3
57b178102c Performance enhancement for lib/grep
- Use $ZSH_CACHE_DIR to store the grep alias with all the right features
- Expire the cache after 24 hours
- See issue #8444
2020-03-01 14:04:36 +01:00
Shi Yan
a8ed1c4e7a Ignore .tox folder in grep 2020-03-01 13:53:04 +01:00
Peter Vandenberk
b4b50f20ac Also set options for egrep and fgrep 2020-03-01 13:51:55 +01:00
Vital Kolas
b6f2cfdb93 Exclude .idea folder from grep search scope 2020-03-01 13:51:52 +01:00
Stephen Heuer
a2cad16790
lib: urlencode hostname in update_terminalapp_cwd (#6245)
Apple's Terminal doesn't open a new tab in your current directory if your hostname has UTF-8 characters in it. Percent encoding the host in addition to the path in update_terminalapp_cwd appears to solve this issue.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-02-28 19:50:17 +01:00
Marc Cornellà
888ab9091c lib: add support for clippaste in WSL using powershell
Source: https://github.com/microsoft/WSL/issues/4852#issuecomment-579616808
2020-02-28 19:07:05 +01:00
j
2b499e1a9e lib: add termux commands to clipboard.zsh (#6243)
Closes #6243
2020-02-27 23:28:14 +01:00
Marc Cornellà
57739cbcb6 lib: add support for clip.exe clipboard copy in WSL 2020-02-27 23:24:23 +01:00
Marc Cornellà
18ee5dffdc
Merge branch 'master' into clipboard 2020-02-27 22:55:30 +01:00
Marc Cornellà
40b013f5f1 lib: delete upgrade lock in upgrade_oh_my_zsh
Provides a different solution to #8332 and #8333
2020-02-24 20:27:21 +01:00
Marc Cornellà
17428f3c9a lib: load bash completion functions automatically
Fixes #8614
2020-02-11 20:16:43 +01:00
Evan Chiu
1c300d3a76 lib: add git function to determine repository name (#4989)
Closes #4989

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-02-10 21:11:31 +01:00
Andras Svraka
56297902e9 lib: add MSYS2 support to clipboard integration (#8542) 2020-01-16 18:19:56 +01:00
Jacob Tomaw
1ba0af650a Use safer append to hook function arrays (#8406)
Use add-zsh-hook to add functions to hooks. That way they won't be added again
when doing `source ~/.zshrc` multiple times.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2019-11-19 18:47:12 +01:00
Marc Cornellà
1546e1226a Fix badly resolved rebase conflict 2019-11-06 19:46:52 +01:00
Marc Cornellà
b7e37cea90 Clean up ignore submodules logic in parse_git_dirty 2019-11-06 19:41:13 +01:00
Wang Guan
7cc3a32bff Add an option about git submodules to ignore
$GIT_STATUS_IGNORE_SUBMODULES can be used to specify handling of
submodules. It can be:
not set : ignore dirty submodules (this was default zsh behavior)
"git"   : do not use "--ignore-submodules" and let git choose,
          this obeys setting in .gitmodules
other   : comes into "--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES"
2019-11-06 19:39:17 +01:00
Shahin Sorkh
3e4d10c4f1 lib: allow alias expansion in _ sudo alias (#8268) 2019-10-16 18:01:15 +02:00
Marc Cornellà
095d56b5ea Fix WSL check for WSL 2 and simplify nohup in open_command
WSL 2 changes the output of `uname -r`. For instance,

  WSL 1: 4.4.0-18980-Microsoft
  WSL 2: 4.19.67-microsoft-standard

Since WSL 2 lowercases the M, we can match for the rest of the string
which remains lowercase throughout both versions. Another option would
be to match for both upper- and lower-case Ms, like that:

  $(uname -r) = *[Mm]icrosoft*

Fixed use of nohup in open_command where it was only necessary for
xdg-open (and actually harmful for cmd.exe in WSL 2). The current logic
is simpler and more future-proof.
2019-09-19 16:20:02 +02:00
Marc Cornellà
e604eaf55e
lib: delete LC_CTYPE locale setting which causes problems
Fixes #7942
2019-08-19 18:17:17 +02:00
Robert Estelle
d81cd753e0 clipboard: Fix bad expansion of exit-code test 2019-07-14 12:56:51 -04:00
Robert Estelle
841008c947 clipboard: Fix tmux clipcopy after testing
Tmux must have special handling for /dev/stdin since it's managing the
terminal itself. This was tested with tmux-2.9a on macOS.
2019-07-14 12:53:30 -04:00
Robert Estelle
d71d3d9905 clipboard: Fix "cilppaste" -> "clippaste" typo 2019-07-14 12:52:47 -04:00
Robert Estelle
01e934d634 clipboard: Add support for several more clipboards
This implements essentially the same heuristic as neovim, with the additional
(existing) special support for Cygwin.
See: e682d799fa/runtime/autoload/provider/clipboard.vim (L55-L121)
  - pbcopy, pbpaste (macOS)
  - cygwin (Windows running Cygwin)
  - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
  - xclip (if $DISPLAY is set)
  - xsel (if $DISPLAY is set)
  - lemonade (for SSH) https://github.com/pocke/lemonade
  - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
  - win32yank (Windows)
  - tmux (if $TMUX is set)
2019-07-12 17:45:57 -04:00
Robert Estelle
956ca639bb clipboard: Avoid unnecessary re-detection each time
Previously, OS detection would happen on each invocation. This makes it
happen once (unless it fails, in which case it will try again on the
next invocation).

This has the additional benefit of localizing the platform-specific
checks and commands, too, versus spreading them out in separate
functions.
2019-07-12 17:45:57 -04:00
Robert Estelle
d855547661 clipboard: Reduce unnecessary special-casing on stdin
Ideally the parameter would just be removed-users could always
just do "clipcopy < some-file". but removing the parameter would break
backwards compatibility.

In any case, this simplifies the logic considerably.
2019-07-12 17:45:57 -04:00
Erik Demaine
902e3172c9 Avoid error messages when there is no job 2019-07-07 10:48:36 -04:00
Erik Demaine
c1446b4750 Automatic title: Replace fg with description from jobs 2019-07-06 12:10:30 -04:00
Marc Cornellà
486fa1010d lib: add ability to disable magic functions
Fixes #5499
Fixes #5569
Fixes #6338
Fixes #6654
Fixes #6255
Fixes #7632

Closes #7763

Co-authored-by: Daniel Galán y Martins <git@galan.de>
2019-05-11 13:47:12 +02:00
Andrew Janke
299cd4777a Themes: switch to using ruby_prompt_info()
Changes themes displaying RVM or other Ruby version info to use the central
ruby_prompt_info function. This supports more Ruby versioning mechanisms,
reduces copy-and-paste code, and avoids "zsh: no such file or directory: rvm-prompt"
when run on machines that do not have RVM installed.

Changes the prefix/suffix variable names to ZSH_THEME_RUBY_PROMPT_PREFIX and
ZSH_THEME_RUBY_PROMPT_SUFFIX, since they apply to all Ruby versioning mechanisms,
not just RVM.

Allows empty ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX.
2019-05-08 08:45:34 +02:00
Marc Cornellà
ea3e666e04 init: run compinit before loading lib/ files 2019-05-07 21:30:06 +02:00
Marc Cornellà
239649ae6a
lib: pass arguments to d to dirs (#6924)
Replace the alias with a function. Call `dirs` if arguments are given to `d`.
2019-05-07 20:53:40 +02:00
Yannis Mitsos
cfd30e9e5c Colored ls output in FreeBSD #7565 2019-04-22 17:24:48 +03:00
Marc Cornellà
5911aea46c
lib: stop detecting git versions prior to 1.7.2
The 1.7.2 release was published in July 2010 [1]. It's about time to stop
supporting older versions.

Fixes #4583

[1] https://github.com/git/git/releases/tag/v1.7.2
2019-04-09 20:38:13 +02:00
David Remy
62abacebea lib: fix issues with nounset and parameters used before defined (#7433) 2019-04-09 12:58:45 +02:00
Marc Cornellà
30594886bf
lib: delete PS1 default
A default PS1 doesn't make sense: the user will either choose a theme or not
care about a default prompt since they can set it themselves.

Fixes #7054
2019-04-08 23:01:55 +02:00
Jeremy Armstrong
8aa8405ea2 termsupport: add support for tmux* $TERM values (#7622) 2019-03-21 20:41:55 +01:00
Konstantin Gizdov
de2395c678 compfix: fix check for empty string (#7674) 2019-03-21 20:35:00 +01:00
Marc Cornellà
55575b88f9 lib: optimize default and env_default 2019-02-25 23:20:47 +01:00
Marc Cornellà
6db298c57a
misc: remove please alias to sudo
Fixes #7527
2019-01-20 17:20:26 +01:00
Marc Cornellà
5a729f6667 lib: fix history wrapper when passing numbers
If a number is passed without explicitly passing `-l`, it will now behave
as if using the history builtin, instead of throwing an error.
2018-09-15 22:56:12 +02:00
Marc Cornellà
fe5fe81c8c
lib: quote arguments to env_default
Fixes #7117
2018-09-09 19:50:23 +02:00
Marc Cornellà
f75d096c1a
lib: small change to git_compare_version
Fixes #7118
2018-09-08 21:35:03 +02:00
John Burwell
e8b9958926 Add jenv plugin
Initializes jenv and provides the jenv_prompt_info funtion to add
Java version information to prompts.  This function is stubbed in
prompt_info_functions script to allow it to be safely called
regardless of whether or not the jenv plugin is loaded.

It also splits detection of the plugin/versions directory and bin directory
to suppport the way Homebrew splits the jenv bin and data directories
2018-08-19 19:12:24 +02:00
Marc Cornellà
2c1ff85bb2
core: fix alias_value function
Fixes #5835
2018-08-09 19:49:02 +02:00