mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 12:03:03 +00:00
fix(coding-agent): off-by-one error in bash output 'earlier lines' count
fixes #921
This commit is contained in:
parent
48fc57f321
commit
3235926eed
2 changed files with 7 additions and 3 deletions
|
|
@ -24,6 +24,10 @@
|
||||||
- Unified collision reporting with `ResourceDiagnostic` type for all resource types ([#645](https://github.com/badlogic/pi-mono/issues/645))
|
- Unified collision reporting with `ResourceDiagnostic` type for all resource types ([#645](https://github.com/badlogic/pi-mono/issues/645))
|
||||||
- Show provider alongside the model in the footer if multiple providers are available
|
- Show provider alongside the model in the footer if multiple providers are available
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Off-by-one error in bash output "earlier lines" count caused by counting spacing newline as hidden content ([#921](https://github.com/badlogic/pi-mono/issues/921))
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- `/reload` now re-renders the entire scrollback so updated extension components are visible immediately
|
- `/reload` now re-renders the entire scrollback so updated extension components are visible immediately
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,6 @@ export class ToolExecutionComponent extends Container {
|
||||||
this.contentBox.addChild(new Text(`\n${styledOutput}`, 0, 0));
|
this.contentBox.addChild(new Text(`\n${styledOutput}`, 0, 0));
|
||||||
} else {
|
} else {
|
||||||
// Use visual line truncation when collapsed with width-aware caching
|
// Use visual line truncation when collapsed with width-aware caching
|
||||||
const textContent = `\n${styledOutput}`;
|
|
||||||
let cachedWidth: number | undefined;
|
let cachedWidth: number | undefined;
|
||||||
let cachedLines: string[] | undefined;
|
let cachedLines: string[] | undefined;
|
||||||
let cachedSkipped: number | undefined;
|
let cachedSkipped: number | undefined;
|
||||||
|
|
@ -376,7 +375,7 @@ export class ToolExecutionComponent extends Container {
|
||||||
this.contentBox.addChild({
|
this.contentBox.addChild({
|
||||||
render: (width: number) => {
|
render: (width: number) => {
|
||||||
if (cachedLines === undefined || cachedWidth !== width) {
|
if (cachedLines === undefined || cachedWidth !== width) {
|
||||||
const result = truncateToVisualLines(textContent, BASH_PREVIEW_LINES, width);
|
const result = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);
|
||||||
cachedLines = result.visualLines;
|
cachedLines = result.visualLines;
|
||||||
cachedSkipped = result.skippedCount;
|
cachedSkipped = result.skippedCount;
|
||||||
cachedWidth = width;
|
cachedWidth = width;
|
||||||
|
|
@ -387,7 +386,8 @@ export class ToolExecutionComponent extends Container {
|
||||||
` ${keyHint("expandTools", "to expand")})`;
|
` ${keyHint("expandTools", "to expand")})`;
|
||||||
return ["", hint, ...cachedLines];
|
return ["", hint, ...cachedLines];
|
||||||
}
|
}
|
||||||
return cachedLines;
|
// Add blank line for spacing (matches expanded case)
|
||||||
|
return ["", ...cachedLines];
|
||||||
},
|
},
|
||||||
invalidate: () => {
|
invalidate: () => {
|
||||||
cachedWidth = undefined;
|
cachedWidth = undefined;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue