I am using the following widget so that I do not have to write git clone to clone a repo.
Code:
function _accept-line-with-url {
if [[ $BUFFER =~ ^https.*git ]]
then
printf "\n"
git clone $BUFFER && cd "$(basename $BUFFER .git)"
zle kill-whole-line
zle .accept-line
else
zle .accept-line
fi
}
zle -N accept-line _accept-line-with-url
However, it has a small problem.
Code:
~/Desktop% https://github.com/chmln/sd.git
Cloning into 'sd'...
remote: Enumerating objects: 78, done.
remote: Counting objects: 100% (78/78), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 792 (delta 34), reused 48 (delta 15), pack-reused 714
Receiving objects: 100% (792/792), 239.98 KiB | 308.00 KiB/s, done.
Resolving deltas: 100% (456/456), done.
Desktop/sd:master=%
If you look at
Desktop/sd:master=% , It is printing an extra blank line before this prompt. Why is that blank line there? How can I remove it?