git-watchtower 1.11.7 → 1.11.9

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.
@@ -1097,7 +1097,9 @@ function write(str) {
1097
1097
  function setTerminalTitle(title) {
1098
1098
  // Set terminal tab/window title using ANSI escape sequence
1099
1099
  // \x1b]0;title\x07 sets both window and tab title (most compatible)
1100
- process.stdout.write(`\x1b]0;${title}\x07`);
1100
+ // Strip control characters to prevent escape sequence injection
1101
+ const safe = String(title).replace(/[\x00-\x1f\x7f]/g, '');
1102
+ process.stdout.write(`\x1b]0;${safe}\x07`);
1101
1103
  }
1102
1104
 
1103
1105
  function restoreTerminalTitle() {
@@ -2219,6 +2221,9 @@ function setupKeyboardInput() {
2219
2221
  process.stdin.resume();
2220
2222
  process.stdin.setEncoding('utf8');
2221
2223
 
2224
+ // Suppress EIO errors that occur when the PTY is torn down during exit
2225
+ process.stdin.on('error', () => {});
2226
+
2222
2227
  process.stdin.on('data', async (key) => {
2223
2228
  // Handle search mode input via actions module
2224
2229
  if (store.get('searchMode')) {
@@ -3223,6 +3228,7 @@ async function shutdown() {
3223
3228
  if (process.stdin.isTTY) {
3224
3229
  process.stdin.setRawMode(false);
3225
3230
  }
3231
+ process.stdin.pause();
3226
3232
 
3227
3233
  if (fileWatcher) fileWatcher.close();
3228
3234
  if (pollIntervalId) clearTimeout(pollIntervalId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.11.7",
3
+ "version": "1.11.9",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
package/src/git/remote.js CHANGED
@@ -71,11 +71,12 @@ function buildBranchUrl(baseUrl, host, branchName) {
71
71
  function detectPlatform(webUrl) {
72
72
  if (!webUrl) return null;
73
73
  try {
74
- const host = new URL(webUrl).hostname;
75
- if (host === 'github.com' || host.includes('github')) return 'github';
76
- if (host === 'gitlab.com' || host.includes('gitlab')) return 'gitlab';
77
- if (host === 'bitbucket.org' || host.includes('bitbucket')) return 'bitbucket';
78
- if (host === 'dev.azure.com' || host.includes('visualstudio.com')) return 'azure';
74
+ const host = new URL(webUrl).hostname.toLowerCase();
75
+ const parts = host.split('.');
76
+ if (host === 'github.com' || parts.includes('github')) return 'github';
77
+ if (host === 'gitlab.com' || parts.includes('gitlab')) return 'gitlab';
78
+ if (host === 'bitbucket.org' || parts.includes('bitbucket')) return 'bitbucket';
79
+ if (host === 'dev.azure.com' || host.endsWith('.visualstudio.com')) return 'azure';
79
80
  } catch (e) { /* ignore */ }
80
81
  return 'github'; // default assumption for self-hosted
81
82
  }