Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
dbd92a62
Unverified
Commit
dbd92a62
authored
Feb 11, 2022
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(updater): do not swallow 1 character in check for user input
Co-authored-by:
Philippe Troin
<
phil@fifi.org
>
parent
7b708519
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
check_for_upgrade.sh
tools/check_for_upgrade.sh
+18
-1
No files found.
tools/check_for_upgrade.sh
View file @
dbd92a62
...
@@ -89,6 +89,23 @@ function update_ohmyzsh() {
...
@@ -89,6 +89,23 @@ function update_ohmyzsh() {
fi
fi
}
}
function
has_typed_input
()
{
# Created by Philippe Troin <phil@fifi.org>
# https://zsh.org/mla/users/2022/msg00062.html
emulate
-L
zsh
zmodload zsh/zselect
{
local
termios
=
$(
stty
--save
)
stty
-icanon
zselect
-t
0
-r
0
return
$?
}
always
{
stty
$termios
}
}
()
{
()
{
emulate
-L
zsh
emulate
-L
zsh
...
@@ -159,7 +176,7 @@ function update_ohmyzsh() {
...
@@ -159,7 +176,7 @@ function update_ohmyzsh() {
fi
fi
# If user has typed input, show reminder and exit
# If user has typed input, show reminder and exit
if
read
-t
-k
1
;
then
if
has_typed_input
;
then
echo
echo
echo
"[oh-my-zsh] It's time to update! You can do that by running
\`
omz update
\`
"
echo
"[oh-my-zsh] It's time to update! You can do that by running
\`
omz update
\`
"
return
0
return
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment