Commit graph

729 commits

Author SHA1 Message Date
Marc Cornellà
0389310390
fix(lib/git): fix detection of function use in prompt
RPS1 and RPROMPT are not equivalent, though they have the same effect.
Added both to detect if `git_prompt_*` is used.

Fixes #12325
2024-04-05 07:38:36 +02:00
Loïc Yhuel
9d529c41cc
perf(async): avoid executing true if not required (#12318)
The issue which required "command true" was fixed in zsh 5.8.
2024-04-04 16:20:20 +02:00
Carlo Sala
114b58ed4e
fix(git): disable locally ksharrays
Fixes #12321
2024-04-04 11:58:43 +02:00
Loïc Yhuel
04007a0e5d
feat(git): implement async completion for git_prompt_status (#12319)
This is important for themes using it, since it is usually a little slower than git_prompt_info.

Also two small fixes :
 - the handler for git_prompt_info was incorrectly named _omz_git_prompt_status
 - _defer_async_git_register was kept in precmd, there is no need to call it on each prompt
2024-04-03 21:32:16 +02:00
Marc Cornellà
ec1afe9dd6
feat(git)!: enable async git prompt (now for real)
BREAKING CHANGE: the new async prompt feature will render prompt information
asyncronously and degrade nicely when the calls take too long to finish, as
the prompt will already be first drawn and interactive. This is
enabled by default for the git prompt and themes that use it (`git_prompt_info`).
If you find that it's not working for you, please open an issue if one is
not already opened, and see https://github.com/ohmyzsh/ohmyzsh#disable-async-git-prompt
for how to turn it off.
2024-04-03 20:09:19 +02:00
Loïc Yhuel
b43b84abc7
fix(async): avoid blocking the shell while waiting (#12304)
Co-authored-by: Marc Cornellà <marc@mcornella.com>
2024-04-03 19:42:47 +02:00
vladislav doster
1d09c6bb0a
style: remove trailing whitespace (#12303) 2024-03-26 09:55:16 +01:00
shuangcui
c8ba08581d
docs: fix typos (#12284) 2024-03-14 23:07:39 +07:00
Marc Cornellà
06753e8146
fix(async): register the git prompt async handler correctly (#12267)
This fix conditionally registers the git prompt async handler only
if `git_prompt_info` is used anywhere in the prompt variables.

This is done in the proper order, so that the async request is
processed once the handler has been registered.

This fix also passes the return value of the previous command
to each of the async handlers, in case they are needed.
2024-03-09 18:29:53 +01:00
Carlo Sala
32d4389aa6
fix(git): disable temporarely async prompt 2024-03-07 17:17:27 +01:00
Marc Cornellà
083cc2c8e8
feat(async)!: implement async prompt API and apply to git prompt (#12257)
BREAKING CHANGE: the `git_prompt_info` prompt function has been
reworked by default to use the new async prompt feature. If you're
experiencing issues see #12257.

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2024-03-07 14:39:05 +01:00
Carlo Sala
8f22370af8
fix(key-bindings): bind default arrow keys to beginning-search
Fixes #12197
2024-02-12 09:48:38 +01:00
vladislav doster
fff073b55d
style(completion): remove extra space (#12206) 2024-02-08 15:41:34 +01:00
Taylor Cochran
70bf12402c
fix(prompt): quote ruby prompt (#12195) 2024-02-03 22:50:44 +01:00
Michal
f7b647e1b1
feat(spectrum): add FX[dim] format (#12172) 2024-01-21 05:25:50 +01:00
Jordan Galby
fa770f9678
fix(clipboard): remove clippaste additional newline on wayland (#12140)
So clippaste behaves the same as on X11 (xsel, xclip).
2023-12-31 11:17:37 +01:00
Marc Cornellà
1ae0515a80
fix(lib): patch omz_urlencode to not encode UTF-8 chars in Termux (#12076)
Fixes #12061
2023-12-06 08:09:45 +01:00
Bernard Grymonpon
7e3fdf33ec
fix(misc): only set PAGER if less or more are available (#12060) 2023-11-27 11:07:51 +01:00
Marc Cornellà
8428442ff0
fix(termsupport): add workaround for directory tracking issues in Konsole
Fixes #11683
Related: 50c6786
2023-10-19 23:24:55 +02:00
James Cuzella
ccce2e1cfd
fix(termsupport): match all foot-like terminfo (#11868) 2023-08-31 23:35:33 +02:00
Carlo Sala
03a0d5bbae
fix(clipboard): load clipboard on usage
Closes #8827
2023-08-24 17:25:51 +02:00
Marc Cornellà
cb8b677488
fix(termsupport): don't report current working directory in SSH sessions (#11703) 2023-06-11 17:02:48 +02:00
Marc Cornellà
50c678687e
fix(termsupport): fix pwd report for Konsole (#11730)
The Konsole terminal shows an error if the host is provided in the
OSC 7 sequence.

Fixes #11730
2023-06-08 18:48:32 +02:00
Carlo Sala
902b79e635
fix(functions): use command env
Closes #11709
2023-05-23 08:43:49 +02:00
Carlo Sala
dcff7a7f08
fix(theme-and-appearance): make bsd ls to be default 2023-05-09 12:05:15 +02:00
Carlo Sala
c5208867f1 feat(theme-and-appearance): allow disabling gnu-ls in bsd
To disable gnu-ls (`gls`) even if it's installed in freeBSD and macOS
you can set it up with:
```zsh
zstyle ':omz:lib:theme-and-appearance' gnu-ls no
```

Closes #11647
2023-05-06 13:39:01 +02:00
Erin Schlarb
5b11e70a96
fix(cli): execute as expected if ksh_arrays is set (#11629) 2023-04-20 13:32:32 +02:00
Alexander Schlarb
25c2c3a468
feat(lib): send OSC 7 on directory change for more supported terminals (#9914)
Previously this was only emitted on macOS with Apple's Terminal.app (and
compatible clones like iTerm2), but it is used by other terminal emulators
as well to obtain the actual current working directory wiht symlinks intact.
All non-supporting terminal emulators tested gracefully ignored this value,
so emit this on these as well in case they (or some other app masquarading
as them) add future support for this value.

Closes #9914

Co-authored-by: Marc Cornellà <hello@mcornella.com>
2023-04-05 00:20:10 +02:00
Christian Parpart
8d23fbd696
feat(termsupport): add contour terminal (#11599)
Signed-off-by: Christian Parpart <christian@parpart.family>
2023-04-04 16:47:13 +02:00
Marc Cornellà
1ad167dfac
feat(init)!: allow turning off aliases for libs and plugins (#11550)
BREAKING CHANGE: the previous zstyle setting to disable `lib/directories.zsh` aliases has
been changed to the new syntax: `zstyle ':omz:lib:directories' aliases no`. See
https://github.com/ohmyzsh/ohmyzsh#skip-aliases to see other ways you can use this setting.
    
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2023-04-03 23:14:36 +02:00
Håvard Bartnes
8f6fbe2389
feat(upgrade): add verbosity settings
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>

Closes #11574
Closes #11579
2023-03-28 12:58:33 +02:00
Marc Cornellà
72732a224e
fix(lib): set equivalent LS_COLORS and LSCOLORS variables
As reported by https://geoff.greer.fm/lscolors

Fixes #11554
2023-03-12 15:47:58 +01:00
Marc Cornellà
d342b353e3
fix(init): set completion colors on theme load, not with precmd
This fixes an edge case where the user actually sets

  zstyle ':completion:*' list-colors

in their zshrc, but the previous code used a precmd hook, which would
override the user changes. With this change our modifications will be
set in the init script, after the theme loads, so that later changes
can affect our defaults.

Note that this will not be run for users on plugin managers, as these
don't generally run our init script.
2023-03-07 18:54:06 +01:00
Marc Cornellà
95d0c4b603
refactor(theme-and-appearance): reorganize and clean up logic (#11529)
Co-authored-by: Andrew Janke <janke@pobox.com>
Co-authored-by: Marcelo Parada <marcelo.parada@axoninsight.com>
Co-authored-by: Uy Ha <hchanuy@gmail.com>
Co-authored-by: Valentin Uveges <valentin.uveges@gmail.com>
2023-03-03 14:38:50 +01:00
Marc Cornellà
5bf7f9c833
fix(lib): use $BROWSER in open_command if set (#11532)
Fixes #11098
2023-03-03 12:34:31 +01:00
Jannik
0ca8907f0e
fix(lib): fix case-insensitive completion for zsh 5.9 (#11526) 2023-02-26 20:37:03 +01:00
Marc Cornellà
277f38212a
refactor: reorganize setopts in lib folder 2023-02-24 20:55:31 +01:00
Marc Cornellà
5cb943eea4
fix(lib): fix return code after expected non-zero exit code (#11524)
Fixes #11524
2023-02-24 17:27:23 +01:00
Carlo Sala
aca048814b
fix(theme-and-appearance): avoid infinite recursion 2023-02-22 15:35:12 +01:00
Carlo Sala
8a68bf6772
fix(theme-and-appearance): test color ls with $ZSH directory
Fixes #11500
2023-02-16 12:54:23 +01:00
Richard Mitchell
574669da6b fix(correction)!: remove aliases for non standard commands
BREAKING CHANGE: This commit removes aliases for some commands that
previously were not being autocorrected. If you are using
autocorrection, please check it.
2023-02-15 09:23:04 +01:00
Richard Mitchell
416560c9bf
docs(lib/directories): comment how to disable alias (#11489) 2023-02-12 17:46:25 +01:00
Julien Rottenberg
379fe0fe13
feat(azure): add azure plugin (#8848)
Co-authored-by: hagridaaron <hagridaaron@gmail.com>
Co-authored-by: Terry <tmoschou@gmail.com>

Closes #8847
2023-02-07 12:33:59 +01:00
Hazael Sanchez
ea4854dba3
feat(directories): add config to skip aliases (#11469)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2023-02-02 11:30:34 +01:00
Carlo Sala
657ad0523d fix(theme-and-appearance): fix diff completion in macOS
Closes #11416
Closes #11454
2023-01-25 18:12:20 +01:00
Joan Marcè i Igual
bf57b4ff3d
feat(functions/take): make .tgz behave as .tar.gz (#11446) 2023-01-20 19:45:14 +01:00
Carlo Sala
df658350a3
fix(clipboard): move wsl detection to higher priority (#11440)
Closes #8827
2023-01-15 17:11:29 +01:00
Marc Cornellà
17ea97332b Revert "fix(lib): send carriage return after title to fix #11314 (#11315)"
This reverts commit 3dd83a22a1.

See https://github.com/ohmyzsh/ohmyzsh/issues/11314#issuecomment-1379492472
2023-01-12 08:29:00 +01:00
Lawton Nichols
3dd83a22a1
fix(lib): send carriage return after title to fix #11314 (#11315)
Window and tab titles are changed by emitting an unprintable escape
sequence to the terminal. These escape sequences do not play nicely
with the TAB character on multiple terminal emulators--they create
un-deletable characters on the first line after command execution.
Sending "\r" after changing the window and tab titles allows all
characters on the first line to be deleted.

Fixes #11314
2023-01-11 19:44:29 +01:00
Banst
6dfc9b960f
feat(git): display tag in git-prompt when possible (#11318)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
2022-11-08 09:34:13 +01:00