Ticket #4599 (closed defect: fixed)

Opened 2 months ago

Last modified 8 weeks ago

Add support for bash PROMPT_COMMAND being an array

Reported by: ceamac Owned by: zaytsev
Priority: minor Milestone: 4.8.33
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Starting with bash 5.1, PROMPT_COMMAND can be an array. Detect this
case and append and entry to the array instead of appending to a string.

The current behaviour is appending the string to the first element in the array.

Testing for bash >= 5 is sufficient, because the @a operator exists in
5.0. We need eval on the "then" branch because bash 1.x cannot even
parse that line (it does not support arrays). Tested with bash 1.14.

Attachments

array-PROMPT_COMMAND.patch (1.9 KB) - added by ceamac 2 months ago.

Change History

Changed 2 months ago by ceamac

comment:1 Changed 2 months ago by zaytsev

  • Owner set to zaytsev
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.33

comment:2 Changed 2 months ago by zaytsev

  • Branch state changed from no branch to on review

Branch: 4599_bash_prompt_array
Changeset: 18f0a28501340c384422864125b53942d792cac7

Thank you for upstream-friendly forwarding and quality patch.

Last edited 8 weeks ago by zaytsev (previous) (diff)

comment:3 Changed 8 weeks ago by zaytsev

Rebased for CI, Andrew, good to go?

comment:4 Changed 8 weeks ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:5 Changed 8 weeks ago by zaytsev

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: d63427d7bdd96c95172e6eac27c6e5e0f949ab77 .

Thank you!

comment:6 Changed 8 weeks ago by zaytsev

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.