Skip to content

Commit 131f811

Browse files
committed
Merge branch 'main' into Fix-Claude-Code-CLI-environment-variable-detection
2 parents 26afa3a + b834fd2 commit 131f811

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ There are also individual properties to check for each specific AI CLI
177177
<!-- snippet: AiCliDetectorProps -->
178178
<a id='snippet-AiCliDetectorProps'></a>
179179
```cs
180-
var isCopilotCli = AiCliDetector.IsCopilotCli;
180+
var isCopilot = AiCliDetector.IsCopilot;
181181
var isAider = AiCliDetector.IsAider;
182182
var isClaudeCode = AiCliDetector.IsClaudeCode;
183183
```

src/DiffEngine.Tests/AiCliDetectorTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ public void Props()
88

99
#region AiCliDetectorProps
1010

11-
var isCopilotCli = AiCliDetector.IsCopilotCli;
11+
var isCopilot = AiCliDetector.IsCopilot;
1212
var isAider = AiCliDetector.IsAider;
1313
var isClaudeCode = AiCliDetector.IsClaudeCode;
1414

1515
#endregion
1616

17+
Assert.True(isCopilot);
1718
// ReSharper restore UnusedVariable
1819
}
1920
}

src/DiffEngine.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<File Path="../appveyor.yml" />
99
<File Path="../claude.md" />
1010
<File Path="../readme.source.md" />
11-
<File Path=".editorconfig" />
11+
<File Path="../.editorconfig" />
1212
<File Path="Directory.Build.props" />
1313
<File Path="Directory.Packages.props" />
1414
<File Path="global.json" />

src/DiffEngine/AiCliDetector.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ static AiCliDetector()
66
{
77
var variables = Environment.GetEnvironmentVariables();
88

9-
// GitHub Copilot CLI
9+
// GitHub Copilot
1010
// https://docs.github.com/en/copilot/using-github-copilot/using-github-copilot-in-the-command-line
11-
IsCopilotCli = variables.Contains("GITHUB_COPILOT_CLI");
11+
IsCopilot = variables.Contains("GITHUB_COPILOT_RUNTIME");
1212

1313
// Aider
1414
// https://aider.chat/docs/config/dotenv.html
@@ -18,12 +18,12 @@ static AiCliDetector()
1818
// https://docs.anthropic.com/en/docs/build-with-claude/claude-cli
1919
IsClaudeCode = variables.Contains("CLAUDECODE") || variables.Contains("CLAUDE_CODE_ENTRYPOINT");
2020

21-
Detected = IsCopilotCli ||
21+
Detected = IsCopilot ||
2222
IsAider ||
2323
IsClaudeCode;
2424
}
2525

26-
public static bool IsCopilotCli { get; }
26+
public static bool IsCopilot { get; }
2727

2828
public static bool IsAider { get; }
2929

src/DiffEngine/Process/WindowsProcess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static bool TryTerminateProcess(int processId)
130130
// First, try graceful shutdown by closing the main window
131131
try
132132
{
133-
using var process = System.Diagnostics.Process.GetProcessById(processId);
133+
using var process = Process.GetProcessById(processId);
134134

135135
// Try to close the main window gracefully
136136
if (process.CloseMainWindow())

0 commit comments

Comments
 (0)