@@ -165,12 +165,14 @@ func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd) {
165165 }
166166 // Handle ctrl+n/p for tab switching
167167 if key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+n" ))) {
168+ before := m .getActiveTabIdx ()
168169 m .nextTab ()
169- return m , m .tabSelectionCommand ( )
170+ return m , m .tabSelectionChangedCmd ( m . getActiveTabIdx () != before )
170171 }
171172 if key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+p" ))) {
173+ before := m .getActiveTabIdx ()
172174 m .prevTab ()
173- return m , m .tabSelectionCommand ( )
175+ return m , m .tabSelectionChangedCmd ( m . getActiveTabIdx () != before )
174176 }
175177 // Forward all other keys to diff viewer
176178 if handled , cmd := m .dispatchDiffInput (tab , msg ); handled {
@@ -183,21 +185,24 @@ func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd) {
183185 // Only intercept these specific keys - everything else goes to terminal
184186 switch {
185187 case key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+n" ))):
188+ before := m .getActiveTabIdx ()
186189 m .nextTab ()
187- return m , m .tabSelectionCommand ( )
190+ return m , m .tabSelectionChangedCmd ( m . getActiveTabIdx () != before )
188191
189192 case key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+p" ))):
193+ before := m .getActiveTabIdx ()
190194 m .prevTab ()
191- return m , m .tabSelectionCommand ( )
195+ return m , m .tabSelectionChangedCmd ( m . getActiveTabIdx () != before )
192196
193197 case key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+w" ))):
194198 // Close tab
195199 return m , m .closeCurrentTab ()
196200
197201 case key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+]" ))):
198202 // Switch to next tab (escape hatch that won't conflict)
203+ before := m .getActiveTabIdx ()
199204 m .nextTab ()
200- return m , m .tabSelectionCommand ( )
205+ return m , m .tabSelectionChangedCmd ( m . getActiveTabIdx () != before )
201206
202207 case key .Matches (msg , key .NewBinding (key .WithKeys ("ctrl+[" ))):
203208 // This is Escape - let it go to terminal
0 commit comments