diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-04-10 06:13:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-04-10 06:17:58 -0700 |
commit | 7023efa48b48dfcd7e1c5cbe6f2310d44abb8efe (patch) | |
tree | 809e9fdc7c1612e74774d4af809d6068129e0999 | |
parent | 10f1fccf8116f00d57562009dee8d335a30bd0a7 (diff) | |
download | basta-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.sh | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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' } |