termpix 0.3.0 → 0.3.2

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: 763bacec25caa2a40043e19c2319b44c9433848e307281a761c4933ce345c227
4
- data.tar.gz: e5fe48498bcf92d6cfccea1fedbec3d4cd33945096682e769a1464bb2248d0d2
3
+ metadata.gz: 95d3e15e1b1d9a862d73b8613665fd576c2f246e5c26949c18e1b926404bae4b
4
+ data.tar.gz: d58c2201aae6c8642f587f48a74dd77695673481e3d875ae2eacd60eaa56e122
5
5
  SHA512:
6
- metadata.gz: b55c954c5ccc8f78922973a8efd3c20a4891509fe9adc7c6baa71f91620d28952379096dbbeab6703799f0c58f6401ef3820e83f89eb0368d37d6e36e5db42b5
7
- data.tar.gz: 890174a649f8cdc54d4506f3ff21075aa5d5f82f2be282101b19ad6e107b37271673272ac8c582ed96d2210a50375435ed31ee9d47fa2ce2259fdfba1749a0c8
6
+ metadata.gz: 65a7dd630c64a04cb6982077175380e3d33d4bf81727ca623cf5d576cd4d6db2feec6106445dd47bc50b070cea5e4cff3ce40f0c57d80d9039ee6e801b98e6ff
7
+ data.tar.gz: ff46fb6a49b7a3ed9429eeb41e491a36235e21216827bf638e81965d1225d772a851e6a06f6ee670786d6576548fa93188bac1faea57922213f9279524e7dca1
@@ -21,8 +21,9 @@ module Termpix
21
21
  pixel_width = max_width * cell_width
22
22
  pixel_height = max_height * cell_height
23
23
 
24
- # Check if we have this image cached
25
- cache_key = "#{image_path}:#{pixel_width}x#{pixel_height}"
24
+ # Check if we have this image cached (include mtime to detect overwrites)
25
+ mtime = File.mtime(image_path).to_i rescue 0
26
+ cache_key = "#{image_path}:#{pixel_width}x#{pixel_height}:#{mtime}"
26
27
  image_id = @image_cache[cache_key]
27
28
 
28
29
  unless image_id
@@ -1,3 +1,3 @@
1
1
  module Termpix
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/termpix.rb CHANGED
@@ -84,6 +84,11 @@ module Termpix
84
84
  return :kitty if check_dependency('convert')
85
85
  end
86
86
 
87
+ # Check for WezTerm - supports Kitty graphics protocol
88
+ if ENV['TERM_PROGRAM'] == 'WezTerm' || ENV['WEZTERM_EXECUTABLE']
89
+ return :kitty if check_dependency('convert')
90
+ end
91
+
87
92
  # Check for Sixel support - works well with curses apps
88
93
  # Note: urxvt/rxvt-unicode does NOT support sixel unless specially compiled
89
94
  if ENV['TERM']&.match(/^xterm(?!-kitty)|^mlterm|^foot/)
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termpix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-16 00:00:00.000000000 Z
11
+ date: 2026-01-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: 'Termpix v0.3.0: Native Kitty graphics protocol - no more flash in kitty
14
- terminal. Provides clean API for displaying images in terminal using best available
15
- protocol (Kitty, Sixel, or w3m). Auto-detects terminal capabilities and falls back
16
- gracefully.'
13
+ description: 'Termpix v0.3.2: Fixed Kitty cache invalidation when files are overwritten.
14
+ Cache key now includes file mtime. Uses Kitty graphics protocol for kitty, WezTerm,
15
+ and Ghostty terminals. Provides clean API for displaying images in terminal using
16
+ best available protocol (Kitty, Sixel, or w3m). Auto-detects terminal capabilities
17
+ and falls back gracefully.'
17
18
  email: g@isene.com
18
19
  executables: []
19
20
  extensions: []