Completion notification is not shown on first command in well-behaved shells

Bug #1485372 reported by Sergey "Shnatsel" Davidoff
6
This bug affects 1 person
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-shell/release-2
sudo apt-get update
sudo apt-get install fish
curl https://raw.githubusercontent.com/Shnatsel/fish-pantheon-terminal-integration/master/config.fish >> ~/.config/fish/config.fish
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

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
Cody Garver (codygarver)
Changed in pantheon-terminal:
importance: Undecided → Medium
Changed in pantheon-terminal:
milestone: loki-beta1 → loki-alpha1
Cody Garver (codygarver)
Changed in pantheon-terminal:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.