--- name: normalize_terminal_output kind: function lang: go domain: tui version: "1.0.0" purity: pure signature: "func NormalizeTerminalOutput(s string) string" description: "Limpia output de terminal: remueve codigos ANSI, normaliza saltos de linea (CRLF/CR a LF) y elimina caracteres de control no imprimibles. Preserva tabs y newlines." tags: [tui, terminal, normalize, clean, output, ansi] uses_functions: [strip_ansi_go_tui] uses_types: [] returns: [] returns_optional: false error_type: "" imports: [strings] params: - name: s desc: "output de terminal con posibles codigos ANSI y caracteres de control" output: "string limpio con solo caracteres imprimibles, tabs y newlines" tested: false tests: [] test_file_path: "" file_path: "functions/tui/normalize_terminal_output.go" source_repo: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git" source_license: "MIT" source_file: "launcher/core/commands.go" --- ## Ejemplo ```go raw := "\033[32mOK\033[0m\r\nLinea 2\x00oculto" clean := tui.NormalizeTerminalOutput(raw) // clean == "OK\nLinea 2oculto" ``` ## Notas Preserva `\n` y `\t` como caracteres validos. Filtra todo caracter con valor < 32 (excepto tab y newline) y DEL (127). Util para capturar output de subprocesos y mostrarlo en TUIs donde los codigos ANSI rompen el render.