[debug/dev] loosen riot username check; autoload zcalc (#40)

* riot: loosen username check as sometimes it's not a unix username

* Revert "riot: loosen username check as sometimes it's not a unix username"

This reverts commit bdb64ce1f2.

* riot: loosen username check as sometimes it's not a unix username

* zshrc: autoload zcalc

---------

Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
This commit is contained in:
Dict Xiong 2023-07-03 16:52:06 +08:00 committed by GitHub
parent 1a62ffe74b
commit 39b8dfce82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -140,6 +140,9 @@ bindkey "\e[1;5D" backward-word # alt+left_arrow; termius
bindkey "\ed" delete-char # alt+d
# mods
autoload zcalc
# dfs
dfs()
{

View File

@ -33,7 +33,7 @@ get_server_meta() {
if [[ "$remote" == *@* ]]; then
RET_USERNAME=${remote%%@*}
remote=${remote#*@}
check_username $RET_USERNAME || fmt_fatal invalid username \"$RET_USERNAME\"
check_username $RET_USERNAME || fmt_warning \"$RET_USERNAME\" is not a valid unix username
fi
# if in the form ...:22
if [[ "$remote" == "["*"]":* || ( "$remote" != "["*"]" && "$remote" == *:* ) ]]; then