Completion notification is not shown on first command in well-behaved shells
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Terminal |
Fix Released
|
Medium
|
Sergey "Shnatsel" Davidoff |
Bug Description
Right now Pantheon Terminal ignores the first process completion callback as a workaround for BASH constraints. BASH calls back to us on every prompt, so the first callback shows history from the previous session. See bug #1356937 for more info and the merge request that introduced the "ignore first callback" stuff (called "is_init_complete" in the code).
Because of that, under more well-behaved shells with proper post-execution callbacks (namely FISH and probably ZSH too) the first process completion notification is legitimate, but gets ignored by Pantheon Terminal.
That suppression mechanism actually sits on top of an earlier suppression mechaism based on tab focus tracking, which I designed myself back in the day to combat this problem with BASH. Ironically, that focus-based suppression (called "ever_had_focus" in the code) disallows working around the "suppress first callback" workaround from well-behaved shells by issuing a dummy callback. So we can't have a workaround for a workaround.
Steps to reproduce (for fish):
sudo apt-add-repository ppa:fish-
sudo apt-get update
sudo apt-get install fish
curl https:/
chsh --shell /usr/bin/fish # will prompt for password
# Close the terminal and reopen it
sleep 5; echo yay
# Switch to another window quickly. No notification appears on completion.
sleep 5; echo yay
# Switch to another window quickly. Notification appears as expected.
Related branches
- xapantu (community): Approve
-
Diff: 145 lines (+62/-18)5 files modifiedCMakeLists.txt (+1/-0)
data/enable-fish-completion-notifications (+29/-0)
data/enable-zsh-completion-notifications (+30/-4)
src/PantheonTerminal.vala (+2/-2)
src/TerminalWidget.vala (+0/-12)
Changed in pantheon-terminal: | |
status: | New → In Progress |
assignee: | nobody → Sergey "Shnatsel" Davidoff (shnatsel) |
Changed in pantheon-terminal: | |
status: | In Progress → Fix Committed |
Changed in pantheon-terminal: | |
milestone: | none → loki-beta1 |
Changed in pantheon-terminal: | |
importance: | Undecided → Medium |
Changed in pantheon-terminal: | |
milestone: | loki-beta1 → loki-alpha1 |
Changed in pantheon-terminal: | |
status: | Fix Committed → Fix Released |