hyper-windowtint 0.3.5 → 0.3.6
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.
- package/CHANGELOG.md +7 -0
- package/README.md +16 -18
- package/index.js +12 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to `hyper-windowtint` will be documented here.
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.6] - 2026-05-16
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- README now shows a real screenshot of four Hyper windows in four projects
|
|
12
|
+
(`docs/demo-hero.png`) instead of the placeholder. Image is referenced via
|
|
13
|
+
full GitHub raw URL so it renders on both github.com and npmjs.com.
|
|
14
|
+
|
|
8
15
|
## [0.3.5] - 2026-05-16
|
|
9
16
|
|
|
10
17
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Give every Hyper terminal window/tab a color so you can tell them apart at a glance, while matching tabs that are currently in the same project during the current Hyper session.
|
|
4
4
|
|
|
5
|
-
Groups each session by its cwd, walked up to the nearest `.git` repo root when possible, then assigns that project group a random color from a curated 12-color palette for the current Hyper run. Restarting Hyper can assign a different color. Shells that emit OSC 7 update the group live when you `cd`. The plugin paints:
|
|
5
|
+
Groups each session by its cwd, walked up to the nearest `.git` repo root when possible, then assigns that project group a random color from a curated 12-color palette for the current Hyper run. Restarting Hyper can assign a different color. Shells that emit OSC 7 update the group live when you `cd`. The plugin paints, in the active project's color:
|
|
6
6
|
|
|
7
|
-
- a thin
|
|
8
|
-
-
|
|
9
|
-
- a
|
|
7
|
+
- a thin border around the window
|
|
8
|
+
- a colored top line in the tab bar
|
|
9
|
+
- a subtle gradient tint on the active tab's background
|
|
10
|
+
- an optional uppercase color-name label in the top-right corner (off by default; opt in with `showBadge: true`)
|
|
10
11
|
|
|
11
|
-
The result: two tabs opened inside the same repo use the same color while they remain in that repo. If one tab moves to a different project and the shell reports cwd changes with OSC 7, that tab
|
|
12
|
+
The result: two tabs opened inside the same repo use the same color while they remain in that repo. If one tab moves to a different project and the shell reports cwd changes with OSC 7, that tab's color follows. A different repo or directory gets its own random color (the plugin prefers palette slots that aren't already in use by other open projects, so collisions only start once you have more than 12 projects open in one Hyper session). If cwd resolution ever fails entirely, the plugin falls back to the session UID so the tab still gets a color.
|
|
12
13
|
|
|
13
14
|
## Screenshots
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
A 5–10s capture of two tabs in different repos plus one `cd` between them
|
|
17
|
-
sells the plugin better than any prose. -->
|
|
16
|
+

|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Four Hyper windows open against four different projects — each gets its own border color, so a glance at the screen tells you which terminal belongs to which codebase.
|
|
20
19
|
|
|
21
20
|
## Install
|
|
22
21
|
|
|
@@ -71,8 +70,8 @@ module.exports = {
|
|
|
71
70
|
config: {
|
|
72
71
|
windowTint: {
|
|
73
72
|
borderWidth: '3px', // CSS string
|
|
74
|
-
showBadge:
|
|
75
|
-
glow: true, // inner glow effect
|
|
73
|
+
showBadge: false, // optional uppercase color-name label in the corner (default off)
|
|
74
|
+
glow: true, // inner glow effect on the window border
|
|
76
75
|
palette: [ // optional — override the default palette
|
|
77
76
|
{ name: 'red', hex: '#ef4444' },
|
|
78
77
|
{ name: 'green', hex: '#22c55e' },
|
|
@@ -90,16 +89,15 @@ Palette entries must include both a non-empty `name` and a 6- or 8-digit hex col
|
|
|
90
89
|
|
|
91
90
|
**Main process:**
|
|
92
91
|
|
|
93
|
-
- `decorateSessionOptions(options)` runs when a new session is about to be spawned.
|
|
94
|
-
- `onWindow(win)` wraps `win.rpc.emit` so that immediately before Hyper's own `'session add'` IPC reaches the renderer, the plugin emits a `'windowtint:session-seed'` event with `{uid, seed}`. This avoids a uid→
|
|
95
|
-
- `onUnload` clears the caches.
|
|
92
|
+
- `decorateSessionOptions(options)` runs when a new session is about to be spawned. The plugin schedules async cwd resolution through `realpath`, walks upward looking for a `.git` directory or file (if found, that path is the project group; otherwise the raw cwd is the group), and assigns the group a random seed for the current Hyper main-process lifetime. Seed assignment prefers palette indices not already used by other open projects so the first 12 distinct projects get 12 distinct colors. Caches `cwd → project root`, `project root → seed`, and `uid → seed` (with a short expiry).
|
|
93
|
+
- `onWindow(win)` wraps `win.rpc.emit` so that immediately before Hyper's own `'session add'` IPC reaches the renderer, the plugin emits a `'windowtint:session-seed'` event with `{uid, seed}`. This avoids a uid→project color flicker on session creation. The wrap is idempotent per window, and reload-stable state on `win.rpc` lets the persistent wrapper consume seeds from the newest plugin module after hot reloads.
|
|
94
|
+
- `onUnload` clears the caches and restores the original `win.rpc.emit`.
|
|
96
95
|
|
|
97
96
|
**Renderer process:**
|
|
98
97
|
|
|
99
|
-
- `decorateTerm`
|
|
100
|
-
- `decorateConfig` injects CSS that styles `.hyper_main
|
|
101
|
-
- A `window.rpc.on('windowtint:session-seed', ...)` listener (installed lazily by the middleware and removed on renderer unload) caches `uid → seed`. If a seed
|
|
102
|
-
- `getTabProps` and `decorateTab` add a small color accent to each tab.
|
|
98
|
+
- `decorateTerm` registers an OSC 7 handler on each tab's xterm instance. When a shell reports a new cwd, the renderer asks the main process for that cwd's current project-group seed and retints.
|
|
99
|
+
- `decorateConfig` injects CSS that styles `.hyper_main` (window border + glow), the tab bar's top line, and the active tab's background gradient using CSS custom properties (`--tint-color`, `--tint-glow`, `--tint-tab-bg`, `--tint-name`).
|
|
100
|
+
- A `window.rpc.on('windowtint:session-seed', ...)` listener (installed lazily by the middleware and removed on renderer unload) caches `uid → seed`. If a seed arrives after the session has already been tinted, the active session retints immediately.
|
|
103
101
|
- Redux middleware listens for `SESSION_ADD` and `SESSION_SET_ACTIVE`, looks up the cached seed by uid (falls back to the uid itself), maps it to the palette, and writes the resulting color to the root element's CSS variables.
|
|
104
102
|
|
|
105
103
|
## Project grouping
|
package/index.js
CHANGED
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
* hyper-windowtint
|
|
5
5
|
*
|
|
6
6
|
* Assigns each Hyper project group an ephemeral random color from a curated
|
|
7
|
-
* palette, then paints the window border, tab
|
|
8
|
-
*
|
|
7
|
+
* 12-color palette, then paints the window border, the tab bar's top line,
|
|
8
|
+
* and the active tab's background gradient in that color. Optionally shows
|
|
9
|
+
* the color's name in the top-right corner (`config.windowTint.showBadge`).
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* walking up from cwd to the nearest `.git`; if none, the raw cwd is used.
|
|
18
|
-
* Falls back to session UID if cwd never arrives.
|
|
11
|
+
* Groups sessions by the project root of the session's cwd, walking up to
|
|
12
|
+
* the nearest `.git` directory or file; if none, the raw cwd is the group.
|
|
13
|
+
* Each project root gets a random seed for the current Hyper main-process
|
|
14
|
+
* lifetime — seeds prefer palette slots not already in use by other open
|
|
15
|
+
* projects, so the first 12 distinct projects get 12 distinct colors.
|
|
16
|
+
* Restarting Hyper reassigns colors. Falls back to session UID if cwd
|
|
17
|
+
* resolution fails entirely.
|
|
19
18
|
*
|
|
20
19
|
* This module is loaded in BOTH Hyper processes. decorateSessionOptions /
|
|
21
20
|
* onWindow / onUnload run in main; decorateConfig / middleware / decorateTerm
|
|
22
|
-
* /
|
|
21
|
+
* / onRendererUnload run in renderer. The two sides communicate via
|
|
23
22
|
* win.rpc — we piggyback a `windowtint:session-seed` event onto the normal
|
|
24
23
|
* `session add` rpc emit so the renderer has the project-group seed before
|
|
25
24
|
* SESSION_ADD reaches the Redux store (no uid→project color flicker).
|
|
@@ -81,7 +80,7 @@ function withAlpha(hex, alpha) {
|
|
|
81
80
|
let userOpts = {
|
|
82
81
|
palette: DEFAULT_PALETTE,
|
|
83
82
|
borderWidth: '3px',
|
|
84
|
-
showBadge:
|
|
83
|
+
showBadge: false,
|
|
85
84
|
glow: true,
|
|
86
85
|
};
|
|
87
86
|
|
package/package.json
CHANGED