commit 53d4dfbc4fee5fb105b75b7fad976d89ec0d7b44
parent 02d296a04e1c27efb6c5d2bd6fe4239d3c45d7da
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Fri, 29 Dec 2023 00:05:56 +0100
restore width once done
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/vimw b/vimw
@@ -2,10 +2,14 @@
WIDTH="$1"
shift
+CURWIDTH=$(stty size | cut -d ' ' -f2)
# vim with at most $WIDTH characters
# https://vi.stackexchange.com/q/43726
stty columns $WIDTH
vim "$@"
+RET=$?
+stty columns $CURWIDTH
+exit $RET