diff options
| author | typebrook <typebrook@gmail.com> | 2020-04-10 11:03:30 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-04-10 11:03:30 +0800 |
| commit | ea0a9ccddc1855c0ace138ff258928faeac022f2 (patch) | |
| tree | f29e2b44d733bd3927dc4d0eac9e02fbe4e4159a | |
| parent | 89887cee78d9f897dae7df8e6301e6bb995438ea (diff) | |
Enable backspace and readline hotkeys with 'gist new'
| -rwxr-xr-x | gist | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -623,7 +623,7 @@ _new_file() { | |||
| 623 | fi | 623 | fi |
| 624 | 624 | ||
| 625 | echo > /dev/tty | 625 | echo > /dev/tty |
| 626 | [[ -z $1 ]] && read -r -p 'Type file name: ' filename < /dev/tty | 626 | [[ -z $1 ]] && read -e -r -p 'Type file name: ' filename < /dev/tty |
| 627 | mv "$tmp_file" /tmp/"$filename" | 627 | mv "$tmp_file" /tmp/"$filename" |
| 628 | echo /tmp/"$filename" | 628 | echo /tmp/"$filename" |
| 629 | } | 629 | } |
| @@ -647,7 +647,7 @@ _create_gist() { | |||
| 647 | _set_gist "$@" || return 1 | 647 | _set_gist "$@" || return 1 |
| 648 | checkInternet || exit 1 | 648 | checkInternet || exit 1 |
| 649 | [[ -z ${files[*]} ]] && files+=($(_new_file "$filename")) | 649 | [[ -z ${files[*]} ]] && files+=($(_new_file "$filename")) |
| 650 | [[ -z $description ]] && read -r -p 'Type description: ' description < /dev/tty | 650 | [[ -z $description ]] && read -e -r -p 'Type description: ' description < /dev/tty |
| 651 | 651 | ||
| 652 | echo 'Creating a new gist...' | 652 | echo 'Creating a new gist...' |
| 653 | http_data=$(mktemp) | 653 | http_data=$(mktemp) |