René's URL Explorer Experiment


Title: 修复提示输入的换行、光标定位与 busy 状态显示 by qorzj · Pull Request #171 · lessweb/deepcode-cli · GitHub

Open Graph Title: 修复提示输入的换行、光标定位与 busy 状态显示 by qorzj · Pull Request #171 · lessweb/deepcode-cli

X Title: 修复提示输入的换行、光标定位与 busy 状态显示 by qorzj · Pull Request #171 · lessweb/deepcode-cli

Description: 变更 统一输入框和提交后 user prompt 回显的前缀宽度与 hard wrap 规则,避免提交后提前换行。 用 Ink 的光标定位能力替换手动 stdout 光标移动,减少重绘时的光标残留。 在输入框布局变化后,只有当前布局完成测量时才启用真实终端光标;测量完成前使用模拟光标,修复选择 skill 后光标位置错误。 调整 busy 状态 UI:spinner 从输入框前缀移到 status 行前方,输入框前缀始终保持 > 。 busy 开始但尚未收到 statusLine 时立即显示 spinner,避免首次提交后输入框上方空白。 busy 状态下统一隐藏真实终端光标和模拟光标,避免 status spinner 与底部进度更新造成光标显示/隐藏冲突和闪烁;非 busy 状态继续使用 IME 友好的真实终端光标。 增加回归测试覆盖提交回显换行、换行边界光标,以及布局测量不匹配时禁用真实终端光标。 实现细节 src/ui/hooks/cursor.ts 改为使用 Ink 7 的 useCursor() 和 useBoxMetrics(),不再 patch stdout.write 或手动写入上下移动光标的 ANSI 序列。 光标位置从原来的 { rowsUp, column } 调整为基于输入区域的 { row, column },再结合 Ink 测量到的输入框绝对位置计算最终 { x, y }。 PromptInput 使用固定的 prompt 前缀宽度计算输入内容宽度,并通过 wrap="hard" 让实时输入、换行边界和提交后回显保持一致。 真实终端光标只在输入聚焦、TTY、无下拉菜单/覆盖提示、非 hard-wrap 边界、非 busy,并且当前布局已完成测量时启用。 当真实终端光标未确认可用时,保留 inverse-video 模拟光标作为回退;busy 状态例外,busy 时光标始终隐藏以避免闪烁。 App 向 PromptInput 传入 cursorLayoutKey,将 status、视图、消息数量、最后一条消息、权限/问题提示等会改变输入框纵向位置的状态纳入布局 key,防止复用旧光标坐标。 StatusLine 独立渲染 busy spinner;即使 status 文本为空,只要 busy 就会显示 spinner。 选中 skill、附件数量和终端宽度继续参与生成 prompt 内部布局 key,防止选择 skill 后继续使用旧布局的光标坐标。 验证 npm run typecheck npm run lint npm run format:check -- src/ui/views/App.tsx src/ui/views/PromptInput.tsx src/ui/hooks/cursor.ts src/ui/hooks/index.ts npm run test:single -- src/tests/prompt-input-keys.test.ts

Open Graph Description: 变更 统一输入框和提交后 user prompt 回显的前缀宽度与 hard wrap 规则,避免提交后提前换行。 用 Ink 的光标定位能力替换手动 stdout 光标移动,减少重绘时的光标残留。 在输入框布局变化后,只有当前布局完成测量时才启用真实终端光标;测量完成前使用模拟光标,修复选择 skill 后光标位置错误。 调整 busy 状态 UI:spinner 从输入框前缀移到 st...

X Description: 变更 统一输入框和提交后 user prompt 回显的前缀宽度与 hard wrap 规则,避免提交后提前换行。 用 Ink 的光标定位能力替换手动 stdout 光标移动,减少重绘时的光标残留。 在输入框布局变化后,只有当前布局完成测量时才启用真实终端光标;测量完成前使用模拟光标,修复选择 skill 后光标位置错误。 调整 busy 状态 UI:spinner 从输入框前缀移到 st...

Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/171

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9ee72e5b-ad32-ee59-c49c-766132ca4480
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8508:4908F:35EF67:4906E7:6A4D2153
html-safe-nonce0baffbd53c5b26c8faa7a7850d8f19e11bdcb47ff55169d8b9eb56da2ac9fd7b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTA4OjQ5MDhGOjM1RUY2Nzo0OTA2RTc6NkE0RDIxNTMiLCJ2aXNpdG9yX2lkIjoiNjczMjc4MzQzNzg0MzYwMzc5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7b75a9a72ddc9c8ce2fda9bd07e614f472b95adcd8e02615da0d516f53142a96
hovercard-subject-tagpull_request:3824811175
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/171/files
twitter:imagehttps://avatars.githubusercontent.com/u/1388815?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1388815?s=400&v=4
og:image:alt变更 统一输入框和提交后 user prompt 回显的前缀宽度与 hard wrap 规则,避免提交后提前换行。 用 Ink 的光标定位能力替换手动 stdout 光标移动,减少重绘时的光标残留。 在输入框布局变化后,只有当前布局完成测量时才启用真实终端光标;测量完成前使用模拟光标,修复选择 skill 后光标位置错误。 调整 busy 状态 UI:spinner 从输入框前缀移到 st...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git
octolytics-dimension-user_id118287711
octolytics-dimension-user_loginlessweb
octolytics-dimension-repository_id1223512305
octolytics-dimension-repository_nwolessweb/deepcode-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1223512305
octolytics-dimension-repository_network_root_nwolessweb/deepcode-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release93f17a978ee60bc4668e1d7b90e6bd2d622261fd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/lessweb/deepcode-cli/pull/171/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F171%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fpull%2F171%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=lessweb%2Fdeepcode-cli
Reloadhttps://github.com/lessweb/deepcode-cli/pull/171/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/171/files
Reloadhttps://github.com/lessweb/deepcode-cli/pull/171/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/171/files
lessweb https://github.com/lessweb
deepcode-clihttps://github.com/lessweb/deepcode-cli
Notifications https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Fork 150 https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Star 1.7k https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Code https://github.com/lessweb/deepcode-cli
Issues 43 https://github.com/lessweb/deepcode-cli/issues
Pull requests 22 https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality 0 https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Code https://github.com/lessweb/deepcode-cli
Issues https://github.com/lessweb/deepcode-cli/issues
Pull requests https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli%2Fissues%2Fnew%2Fchoose
qorzjhttps://github.com/qorzj
mainhttps://github.com/lessweb/deepcode-cli/tree/main
fix/prompt-cursor-wrappinghttps://github.com/lessweb/deepcode-cli/tree/fix/prompt-cursor-wrapping
Conversation 0 https://github.com/lessweb/deepcode-cli/pull/171
Commits 2 https://github.com/lessweb/deepcode-cli/pull/171/commits
Checks 18 https://github.com/lessweb/deepcode-cli/pull/171/checks
Files changed https://github.com/lessweb/deepcode-cli/pull/171/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/171/files
修复提示输入的换行、光标定位与 busy 状态显示 https://github.com/lessweb/deepcode-cli/pull/171/files#top
Show all changes 2 commits https://github.com/lessweb/deepcode-cli/pull/171/files
7fa00dc fix(ui): stabilize prompt cursor wrapping qorzj Jun 8, 2026 https://github.com/lessweb/deepcode-cli/pull/171/commits/7fa00dcf4d1cb5be1daadba1103fb19f1808e9a0
4cf5cc0 fix(ui): improve prompt cursor wrapping and status line display qorzj Jun 9, 2026 https://github.com/lessweb/deepcode-cli/pull/171/commits/4cf5cc0bd86670ded58c9a8c4a737060266471cd
Clear filters https://github.com/lessweb/deepcode-cli/pull/171/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/171/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/171/files
message-view.test.ts https://github.com/lessweb/deepcode-cli/pull/171/files#diff-53723c7326892e52e1105b6d49b7b99dc85d777ead58d44e6d364a85f62324dc
prompt-input-keys.test.ts https://github.com/lessweb/deepcode-cli/pull/171/files#diff-d334fb686a75cb77fe36fd6df6ef1cd581d343df0c5729952dfa7c16d8e8fde4
index.tsx https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
cursor.ts https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fa4a6d723b76b2d7fd07be9c75abb5e36487d644897c53c5724792fa31183bef
index.ts https://github.com/lessweb/deepcode-cli/pull/171/files#diff-ee8cc39bfc7a1491381875ab294f208efcbf392dd9fcc10cc777f87ee30b8b5f
index.ts https://github.com/lessweb/deepcode-cli/pull/171/files#diff-8b9f572e7b966526733261e0898fc2731a8757c4427d099194655c1390aef48e
App.tsx https://github.com/lessweb/deepcode-cli/pull/171/files#diff-97f275ddfd329ef87bec16a446c00d668f0a4aef6efa5ef303b52d1344452fc4
PromptInput.tsx https://github.com/lessweb/deepcode-cli/pull/171/files#diff-c24015d77852f661d1c491d2aa6fc40375cb6026848a5969a48f14cda169f6a3
src/tests/message-view.test.tshttps://github.com/lessweb/deepcode-cli/pull/171/files#diff-53723c7326892e52e1105b6d49b7b99dc85d777ead58d44e6d364a85f62324dc
View file https://github.com/lessweb/deepcode-cli/blob/4cf5cc0bd86670ded58c9a8c4a737060266471cd/src/tests/message-view.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/171/{{ revealButtonHref }}
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-53723c7326892e52e1105b6d49b7b99dc85d777ead58d44e6d364a85f62324dc
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-53723c7326892e52e1105b6d49b7b99dc85d777ead58d44e6d364a85f62324dc
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-53723c7326892e52e1105b6d49b7b99dc85d777ead58d44e6d364a85f62324dc
src/tests/prompt-input-keys.test.tshttps://github.com/lessweb/deepcode-cli/pull/171/files#diff-d334fb686a75cb77fe36fd6df6ef1cd581d343df0c5729952dfa7c16d8e8fde4
View file https://github.com/lessweb/deepcode-cli/blob/4cf5cc0bd86670ded58c9a8c4a737060266471cd/src/tests/prompt-input-keys.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/171/{{ revealButtonHref }}
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-d334fb686a75cb77fe36fd6df6ef1cd581d343df0c5729952dfa7c16d8e8fde4
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-d334fb686a75cb77fe36fd6df6ef1cd581d343df0c5729952dfa7c16d8e8fde4
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-d334fb686a75cb77fe36fd6df6ef1cd581d343df0c5729952dfa7c16d8e8fde4
src/ui/components/MessageView/index.tsxhttps://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
View file https://github.com/lessweb/deepcode-cli/blob/4cf5cc0bd86670ded58c9a8c4a737060266471cd/src/ui/components/MessageView/index.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/lessweb/deepcode-cli/pull/171/{{ revealButtonHref }}
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
https://github.com/lessweb/deepcode-cli/pull/171/files#diff-fc070bd493edb19b0d2fcf473fd0b4a5fbb363c2aa90a9d6c55c499368c87459
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/171/files
Please reload this pagehttps://github.com/lessweb/deepcode-cli/pull/171/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.