Commit d32863d
committed
fix: Update prompt after a syntax error.
Before this change, the prompt may be left to the special bash prompt
after a syntax error, because Bash won't execute the DEBUG trap at all
in such a scenario. At least recent ones won't; that might depend on the
exact version of Bash.
This change switches to a new scheme that recovers PS1 after bash has
executed commands without relying on a trap. This means that PS1 may be
printed, but after the special bash-completion marker, so the string
will be skipped.
PROMPT_COMMAND is still recovered as it was before this change, using a
DEBUG trap, to avoid slow prompt command making completion unusable. The
drawback of this approach is that that PS1 may not updated after a bash
syntax error as it would normally.
issue #791 parent 5205034 commit d32863d
File tree
2 files changed
+13
-36
lines changed- test
2 files changed
+13
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
1539 | | - | |
| 1539 | + | |
1540 | 1540 | | |
1541 | 1541 | | |
1542 | 1542 | | |
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
| 1552 | + | |
1556 | 1553 | | |
1557 | | - | |
1558 | | - | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
1559 | 1562 | | |
1560 | 1563 | | |
1561 | 1564 | | |
| |||
1568 | 1571 | | |
1569 | 1572 | | |
1570 | 1573 | | |
1571 | | - | |
| 1574 | + | |
1572 | 1575 | | |
1573 | | - | |
1574 | | - | |
| 1576 | + | |
| 1577 | + | |
1575 | 1578 | | |
1576 | 1579 | | |
1577 | 1580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | 963 | | |
0 commit comments