hiiro 0.1.339 → 0.1.340

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcaeb672d1c537efc87a229a1db28b61533c42507dc9418732297d0564cb0903
4
- data.tar.gz: 8d90d568d5a7d4b601a267deb60039c74acec7b1151fe1026dac06f60669bdf1
3
+ metadata.gz: 413a819364e3fce84109acbe813f653663567f5c2cb7025a2f2af4ab940051a5
4
+ data.tar.gz: 3b2082944a38035fcb96635c376b738e2aff83ad6d63e211e12d4693c738058a
5
5
  SHA512:
6
- metadata.gz: 43edf56c4056bb07b893c6c93a7b34cf2ea760d52f94f8c243835250c3bcf3c508a61ec3e7ab835d61808e8fc87bf4a400d9387a5afbe4e660c7ca32f30d084a
7
- data.tar.gz: 63a2754cfebf1a3fba0d6145d9abd7df41b8b2d90a6a0342f2da9d23a9a3674bde800bce9b000d9de587e5de7e01ef7f7f0e7345f76a319c06b53895463067bf
6
+ metadata.gz: 8e0dc534669ec4d03fc1549167a7bae54229398d253f843025a10fb99ee1b727eebb80c9287cb5c17d15e46186257049edad67f55de5126e900590b9e05a4ea8
7
+ data.tar.gz: 1451f79da21cbe8be1c98b46425e66f405fe2a2e87be9039b99ad753c7901dff025676fa73cea0e801a9f82c7234d1de554a1e0ceff282ba3b589a673d115f03
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.340] - 2026-04-07
4
+
5
+ ### Fixed
6
+ - `h notify jump` now runs `switch-client` before `select-window`/`select-pane` so jumping to a pane in a different session actually works
7
+ - `h notify ls` and `h notify menu` now auto-prune stale entries for panes that no longer exist
8
+
9
+ ### Added
10
+ - `h notify prune` — explicitly remove all notifications for dead panes
11
+
3
12
  ## [0.1.339] - 2026-04-07
4
13
 
5
14
  ### Added
data/bin/h-notify CHANGED
@@ -121,16 +121,37 @@ Hiiro.run(*ARGV, tasks: true) do
121
121
  if data.empty?
122
122
  puts "No notifications."
123
123
  else
124
- data.each_with_index do |e, i|
125
- time_str = Time.at(e['timestamp']).strftime('%H:%M:%S')
126
- prefix = TYPE_PRESETS[e['type']]&.dig(:prefix) || '[INFO]'
127
- puts "%3d) %s [%s/%s] %s: %s (%s)" % [i, prefix, e['session'], e['pane_id'], e['pane_cmd'], e['message'], time_str]
124
+ live_ids = Hiiro::Tmux::Panes.fetch(all: true).ids.to_set
125
+ pruned = data.reject { |e| live_ids.include?(e['pane_id']) }
126
+ data = data.select { |e| live_ids.include?(e['pane_id']) }
127
+ write_log(data) if pruned.any?
128
+
129
+ if data.empty?
130
+ puts "No notifications (#{pruned.size} stale entries removed)."
131
+ else
132
+ puts "(#{pruned.size} stale entries removed.)" if pruned.any?
133
+ data.each_with_index do |e, i|
134
+ time_str = Time.at(e['timestamp']).strftime('%H:%M:%S')
135
+ prefix = TYPE_PRESETS[e['type']]&.dig(:prefix) || '[INFO]'
136
+ puts "%3d) %s [%s/%s] %s: %s (%s)" % [i, prefix, e['session'], e['pane_id'], e['pane_cmd'], e['message'], time_str]
137
+ end
128
138
  end
129
139
  end
130
140
  end
131
141
 
142
+ add_subcmd(:prune) do
143
+ data = read_log
144
+ live_ids = Hiiro::Tmux::Panes.fetch(all: true).ids.to_set
145
+ pruned = data.reject { |e| live_ids.include?(e['pane_id']) }
146
+ write_log(data.select { |e| live_ids.include?(e['pane_id']) })
147
+ puts "Removed #{pruned.size} stale notification(s). #{data.size - pruned.size} remaining."
148
+ end
149
+
132
150
  add_subcmd(:menu) do
133
- entries = read_log
151
+ data = read_log
152
+ live_ids = Hiiro::Tmux::Panes.fetch(all: true).ids.to_set
153
+ entries = data.select { |e| live_ids.include?(e['pane_id']) }
154
+ write_log(entries) if entries.size != data.size
134
155
 
135
156
  if entries.empty?
136
157
  next
@@ -169,8 +190,9 @@ Hiiro.run(*ARGV, tasks: true) do
169
190
  next
170
191
  end
171
192
 
172
- tmux_client.select_window(entry['window_id'])
173
- tmux_client.select_pane(entry['pane_id'])
193
+ system('tmux', 'switch-client', '-t', entry['session'])
194
+ system('tmux', 'select-window', '-t', entry['window_id'])
195
+ system('tmux', 'select-pane', '-t', entry['pane_id'])
174
196
 
175
197
  data.delete_at(index)
176
198
  write_log(data)
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.339"
2
+ VERSION = "0.1.340"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.339
4
+ version: 0.1.340
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota