UPSTREAM PR #17566: feat(repl): add configurable external hinter closure#52
UPSTREAM PR #17566: feat(repl): add configurable external hinter closure#52
Conversation
Can be used with shell history tools like atuin
OverviewAnalysis of Nushell binary Function AnalysisThe largest performance changes occur in functions with no corresponding source code modifications, indicating compiler optimization variance rather than functional regressions. Key findings: HTTP Client Destructors: Multiple Experimental Commands: Performance-Critical Function: Third-Party Dependencies: Value Type Cleanup: Other analyzed functions including path operations, hash implementations, and error handling destructors saw performance changes ranging from 20-1,000% but remain under 3μs absolute impact in non-critical paths. Additional FindingsAll code changes target REPL hinter functionality with no modifications to core execution paths (IR execution, pipeline data flow, parser, command calls). The pattern of unchanged throughput time with increased response time across multiple functions, combined with zero source code changes in affected areas, strongly indicates compiler optimization differences between builds rather than functional regressions. The single performance-critical regression ( 🔎 Full breakdown: Loci Inspector. |
6102c29 to
d8ed90c
Compare
Note
Source pull request: nushell/nushell#17566
Summary
Adds support for a configurable external REPL hinter closure via
$env.config.line_editor.external.hinter.Users can now provide a Nu closure that receives context (
line,pos,cwd) and returns either:stringhint suffix to show/acceptnullto fall back to the built-inCwdAwareHinterThis change is backward-compatible by default (
closure = null,enable = true) and keeps existing hint behavior when external hinting is disabled, missing, or errors.Discussion thread: Discord
Examples