Skip to content

⭐️ shell rewrite#6350

Merged
chris-rock merged 17 commits intomainfrom
chris-rock/prompt
Jan 8, 2026
Merged

⭐️ shell rewrite#6350
chris-rock merged 17 commits intomainfrom
chris-rock/prompt

Conversation

@chris-rock
Copy link
Copy Markdown
Member

@chris-rock chris-rock commented Jan 5, 2026

This is a rewrite of the shell for the modern world:

  • search of history with ctrl+r
  • multi-line paste
  • simple syntax highlighting for MQL queries
  • shows spinner for slower queries
  • filter resources by connected provider
  • shows asset information
  • Removes github.com/c-bata/go-prompt

macOS

Screenshot 2026-01-05 at 20 34 03

Windows Server 2025

shell_windows_2 shell_windows

Windows 2019

Screenshot 2026-01-05 at 23 16 00

TODO:

  • Test in CMD
  • Test in Powershell

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

Test Results

4 725 tests   - 1   4 721 ✅  - 1   2m 14s ⏱️ -16s
  415 suites ±0       4 💤 ±0 
   31 files   ±0       0 ❌ ±0 

Results for commit 4b4b9e0. ± Comparison against base commit aa7bb1f.

This pull request removes 1 test.
go.mondoo.com/cnquery/v12/cli/shell ‑ TestShell_Help

♻️ This comment has been updated with latest results.

@arlimus
Copy link
Copy Markdown
Member

arlimus commented Jan 5, 2026

fett

@chris-rock chris-rock force-pushed the chris-rock/prompt branch 2 times, most recently from aaa49da to 4fd5332 Compare January 5, 2026 20:55
}
return m, nil

case "ctrl+j":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on making this shift+return?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried shift+return but some terminals just return "return" so i was not able to catch the difference. Probably I missed something.

Copy link
Copy Markdown
Contributor

@jaym jaym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly works as expected. Ran into a few things:

  • up/down don't automatically do history
  • If I do something like asset.bui and tab complete, I get an error message and the result:
> asset.build
asset.build: "25C56"
>                                                                                                                                                                 
⚠ cannot find field 'bui' in asset

@chris-rock
Copy link
Copy Markdown
Member Author

mostly works as expected. Ran into a few things:

* up/down don't automatically do history

* If I do something like `asset.bui` and tab complete, I get an error message and the result:
> asset.build
asset.build: "25C56"
>                                                                                                                                                                 
⚠ cannot find field 'bui' in asset

I explicitly removed that since we have multi-line input now and doing up/down for the text field and the history was not working well since it is unclear when you want to navigate in multiline and when you want to search the history.

@chris-rock
Copy link
Copy Markdown
Member Author

mostly works as expected. Ran into a few things:

* up/down don't automatically do history

* If I do something like `asset.bui` and tab complete, I get an error message and the result:
> asset.build
asset.build: "25C56"
>                                                                                                                                                                 
⚠ cannot find field 'bui' in asset

I am going to fix that one

@chris-rock
Copy link
Copy Markdown
Member Author

updated the PR, fixed the issue Jay saw, added resource filter by connected provider and added a new help menu

@chris-rock chris-rock merged commit 124178c into main Jan 8, 2026
19 checks passed
@chris-rock chris-rock deleted the chris-rock/prompt branch January 8, 2026 10:50
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants