Skip to content

Commit 62888ce

Browse files
authored
Merge pull request microsoft#263248 from microsoft/tyriar/261648
Remove truncated preview from full command line option
2 parents 48aa70f + c5baf64 commit 62888ce

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@ export function generateAutoApproveActions(commandLine: string, subCommands: str
9999
// word
100100
const firstSubcommandFirstWord = unapprovedSubCommands.length > 0 ? unapprovedSubCommands[0].split(' ')[0] : '';
101101
if (firstSubcommandFirstWord !== commandLine) {
102-
const truncatedCommandLine = commandLine.length > 40 ? commandLine.substring(0, 40) + '\u2026' : commandLine;
103102
actions.push({
104-
// Add an extra & since it's treated as a mnemonic
105-
label: localize('autoApprove.exactCommand', 'Always Allow Exact Command Line: {0}', truncatedCommandLine.replaceAll('&&', '&&&')),
103+
label: localize('autoApprove.exactCommand', 'Always Allow Exact Command Line'),
106104
data: {
107105
type: 'newRule',
108106
rule: {

src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/runInTerminalTool.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ suite('RunInTerminalTool', () => {
472472
ok(Array.isArray(customActions[0].data.rule), 'Expected rule to be an array');
473473

474474
ok(!isSeparator(customActions[1]));
475-
strictEqual(customActions[1].label, 'Always Allow Exact Command Line: npm run build');
475+
strictEqual(customActions[1].label, 'Always Allow Exact Command Line');
476476
strictEqual(customActions[1].data.type, 'newRule');
477477
ok(!Array.isArray(customActions[1].data.rule), 'Expected rule to be an object');
478478

@@ -559,7 +559,7 @@ suite('RunInTerminalTool', () => {
559559
strictEqual(customActions[0].data.type, 'newRule');
560560

561561
ok(!isSeparator(customActions[1]));
562-
strictEqual(customActions[1].label, 'Always Allow Exact Command Line: npm install &&& npm run build');
562+
strictEqual(customActions[1].label, 'Always Allow Exact Command Line');
563563
strictEqual(customActions[1].data.type, 'newRule');
564564

565565
ok(isSeparator(customActions[2]));
@@ -590,7 +590,7 @@ suite('RunInTerminalTool', () => {
590590
strictEqual(customActions[0].data.type, 'newRule');
591591

592592
ok(!isSeparator(customActions[1]));
593-
strictEqual(customActions[1].label, 'Always Allow Exact Command Line: foo | head -20');
593+
strictEqual(customActions[1].label, 'Always Allow Exact Command Line');
594594
strictEqual(customActions[1].data.type, 'newRule');
595595

596596
ok(isSeparator(customActions[2]));
@@ -636,7 +636,7 @@ suite('RunInTerminalTool', () => {
636636
strictEqual(customActions[0].data.type, 'newRule');
637637

638638
ok(!isSeparator(customActions[1]));
639-
strictEqual(customActions[1].label, 'Always Allow Exact Command Line: foo | head -20 &&& bar | tail -10');
639+
strictEqual(customActions[1].label, 'Always Allow Exact Command Line');
640640
strictEqual(customActions[1].data.type, 'newRule');
641641

642642
ok(isSeparator(customActions[2]));

0 commit comments

Comments
 (0)