git-watchtower 1.11.7 → 1.11.8

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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.11.7",
3
+ "version": "1.11.8",
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
  }