aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-04-10 06:13:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-04-10 06:17:58 -0700
commit7023efa48b48dfcd7e1c5cbe6f2310d44abb8efe (patch)
tree809e9fdc7c1612e74774d4af809d6068129e0999
parent10f1fccf8116f00d57562009dee8d335a30bd0a7 (diff)
downloadbasta-7023efa48b48dfcd7e1c5cbe6f2310d44abb8efe.tar.gz
basta-7023efa48b48dfcd7e1c5cbe6f2310d44abb8efe.tar.bz2
basta-7023efa48b48dfcd7e1c5cbe6f2310d44abb8efe.zip
Streamline $_ saving.
- Remove basta_uln_save variable. - In basta.alarm_timer use nicer sequence for saving and restoring $_, stashing it directly in the command's expansion, without requiring the global variable, taking advantage of our handler ignoring its arguments. - Independently pointed out by Janis Papagnou and Koichi Murase.
-rw-r--r--basta.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/basta.sh b/basta.sh
index 61527ff..099c959 100644
--- a/basta.sh
+++ b/basta.sh
@@ -8,7 +8,6 @@ basta_scroll_lines=${basta_scroll_lines-0}
basta_prev_reserved_rows=${basta_prev_reserved_rows-}
basta_status_alarm_pid=${basta_status_alarm_pid-}
-basta_uln_save=
basta.query_terminal_lines()
{
@@ -137,7 +136,7 @@ basta.alarm_timer()
basta.install_hooks()
{
- trap 'basta_uln_save=$_; basta.update_status; : "$basta_uln_save"' ALRM WINCH
+ trap 'basta.update_status "$_"' ALRM WINCH
trap basta.cleanup EXIT
PROMPT_COMMAND='basta.initial_prompt_hook'
}