Merge lp:~shnatsel/pantheon-terminal/better-explanation-of-initial-process-callback into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Sergey "Shnatsel" Davidoff
Status: Merged
Approved by: xapantu
Approved revision: 748
Merged at revision: 748
Proposed branch: lp:~shnatsel/pantheon-terminal/better-explanation-of-initial-process-callback
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 64 lines (+17/-22)
2 files modified
data/enable-fish-completion-notifications (+8/-11)
data/enable-zsh-completion-notifications (+9/-11)
To merge this branch: bzr merge lp:~shnatsel/pantheon-terminal/better-explanation-of-initial-process-callback
Reviewer Review Type Date Requested Status
Adam Bieńkowski (community) Approve
Review via email: mp+268477@code.launchpad.net

Commit message

More clear explanation for the initial dummy callbacks from shells with proper post-execution hooks

Description of the change

Better explanation of the initial dummy callbacks from shells with proper post-execution hooks

To post a comment you must log in.
Revision history for this message
Adam Bieńkowski (donadigo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/enable-fish-completion-notifications'
2--- data/enable-fish-completion-notifications 2015-08-16 21:21:32 +0000
3+++ data/enable-fish-completion-notifications 2015-08-19 12:26:22 +0000
4@@ -13,17 +13,14 @@
5 end
6 end
7
8-# Work around Pantheon Terminal's workarounds for how constrained BASH is.
9+# Some shells (e.g. BASH) lack the post-execution hook,
10+# so we insert a callback into their pre-prompt hook instead.
11+# This results in a bogus callback on first prompt, which has to be ignored.
12+# I've tried some clever focus-based suppression but it was prone to race conditions.
13+# The only reliable way to work that around that we've found
14+# is always ignoring the first callback in each tab on the terminal side
15+# and deliberately issuing a fake callback from shells with a proper
16+# post-execution hook, such zsh and fish.
17 if status --is-interactive; and set --query PANTHEON_TERMINAL_ID
18 pantheon-terminal-process-completion-callback "You should not have seen this, please report the incident to Pantheon Terminal developers."
19 end
20-# Yes, really, and that's terrifying.
21-# BASH has no usable post-execution hook, but it has a convenient pre-promt hook
22-# available from an environment variable, so we use that.
23-# But that generates an extra notification on startup which has to be suppressed.
24-# And so far the only reliable way to do that we came up with
25-# was ignoring the first callback in each tab.
26-# Just like that.
27-# I've tried some clever focus-based trickery, but it was unreliable:
28-# https://bugs.launchpad.net/pantheon-terminal/+bug/1356937
29-# Please let us know if you come up with anything better or can patch BASH.
30
31=== modified file 'data/enable-zsh-completion-notifications'
32--- data/enable-zsh-completion-notifications 2015-08-16 21:33:52 +0000
33+++ data/enable-zsh-completion-notifications 2015-08-19 12:26:22 +0000
34@@ -23,7 +23,14 @@
35 precmd_functions=(pantheon_terminal_command_competion_callback)
36 fi
37
38-# Work around Pantheon Terminal's workarounds for how constrained BASH is.
39+# Some shells (e.g. BASH) lack the post-execution hook,
40+# so we insert a callback into their pre-prompt hook instead.
41+# This results in a bogus callback on first prompt, which has to be ignored.
42+# I've tried some clever focus-based suppression but it was prone to race conditions.
43+# The only reliable way to work that around that we've found
44+# is always ignoring the first callback in each tab on the terminal side
45+# and deliberately issuing a fake callback from shells with a proper
46+# post-execution hook, such zsh and fish.
47 if [[ -n "$PANTHEON_TERMINAL_ID" ]] \
48 && builtin hash dbus-send 2> /dev/null
49 then
50@@ -36,13 +43,4 @@
51 string:$PANTHEON_TERMINAL_ID \
52 string:"You should not have seen this, please report the incident to Pantheon Terminal developers."
53 fi
54-# Yes, really, and that's terrifying.
55-# BASH has no usable post-execution hook, but it has a convenient pre-promt hook
56-# available from an environment variable, so we use that.
57-# But that generates an extra notification on startup which has to be suppressed.
58-# And so far the only reliable way to do that we came up with
59-# was ignoring the first callback in each tab.
60-# Just like that.
61-# I've tried some clever focus-based trickery, but it was unreliable:
62-# https://bugs.launchpad.net/pantheon-terminal/+bug/1356937
63-# Please let us know if you come up with anything better or can patch BASH.
64+

Subscribers

People subscribed via source and target branches