-
Notifications
You must be signed in to change notification settings - Fork 51
Closed as not planned
Closed as not planned
Copy link
Labels
automationcode-cleanupcode-qualityconsole-outputcookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!task-mining
Description
Description
One file contains a hardcoded ANSI escape sequence for clearing the screen, violating the codebase's console package abstraction and potentially failing in non-TTY environments.
Problem
File: pkg/cli/add_interactive_orchestrator.go:65
fmt.Fprint(os.Stderr, "\033[H\033[2J") // Clear screen - hardcoded ANSIThis:
- Bypasses TTY detection (may output ANSI codes to pipes/files)
- Violates console package abstraction
- Duplicates logic that should be centralized
Suggested Changes
Option 1: Add to console package
// pkg/console/console.go
const clearScreenSequence = "\033[2J\033[H"
func ClearScreen() {
if isTTY() {
fmt.Fprint(os.Stderr, clearScreenSequence)
}
}Option 2: Use Lipgloss (if available)
// Check if Lipgloss provides a clear screen helper
func ClearScreen() {
if isTTY() {
// Use Lipgloss constant/function
}
}Then update the call site
// pkg/cli/add_interactive_orchestrator.go:65
// Before
fmt.Fprint(os.Stderr, "\033[H\033[2J")
// After
console.ClearScreen()Files Affected
pkg/cli/add_interactive_orchestrator.go(line 65) - Update call sitepkg/console/console.go- Add ClearScreen() function
Success Criteria
- Remove hardcoded ANSI escape sequence
- Add TTY detection before clearing screen
- Centralize in console package
- Test in both TTY and non-TTY environments
Source
Extracted from Terminal Stylist Report: Console Output Pattern Analysis
Priority
Medium - Code quality improvement, low risk
Estimated Effort
Small (1 hour) - Quick win with clear fix
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 13, 2026, 1:26 PM UTC
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
automationcode-cleanupcode-qualityconsole-outputcookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!task-mining