shrs icon indicating copy to clipboard operation
shrs copied to clipboard

[Feature]: windows native (not WSL support)

Open trajano opened this issue 6 months ago • 1 comments

What would you like to see added?

I am thinking of tinkering with this, but I was wondering if the core part is executable in Windows natively? I'm not looking for a full POSIX compliance, but just enough for a usable shell that is more or less bash compatible

re: https://github.com/fish-shell/fish-shell/discussions/10123#discussioncomment-7938904

My imagination is something along the lines of

  1. use SQLite to manage the history so it can span across shell instances.
  2. simplified aliae
    • removal of aliases and just use functions al-throughout
  3. have a richer set of controls that can be leveraged by the most complicated oh-my-posh theme
    • right-side prompts
    • "ghost" prompts (not sure what those are called actually, but those that appear left behind)
  4. terminal capability detection
  • handle resolution change events
  • provide capability checks to see whether double-width fonts
  • somehow ... pass the font name to the environment variables.
  1. by default disable flow control and other multi-key constructs
  2. use Windows shortcuts if the TTY is detected to be Windows and such supports the full keyboard without ESC
  • Ctrl Left Right to change words
  • ESC to clear line
  • Pause (not Ctrl-S) to pause the terminal
  • Ctrl-Z still suspends
  • Ctrl-L still clears the screen, but starts a new prompt
  • Ctrl-End clears to the end of the line
  • Ctrl-Del deletes the word
  • End goes to the end of the line
  • Home goes to the beginning of the line
  1. use Mac shortcuts when the TTY is detected to be macOS (although I don't know much of the for shortcuts for MacOS, but assuming they had a proper keyboard (not a macbook one) then I think it would have similar shortcuts as Windows.
  2. history UI
  • up starts line history mode. (it's not the same as readline mode which sort of does weird things like if you change the text on one go up and down it retains it)
  • basically only append (no update)
  • special hook for oh-my-posh to display history
  • Typing then pressing up will search for the history for the entry
  • page up brings up the history as a popup window that allows searches
  1. command completion API that is bash compatible at minimum, but allows for more possibilities from there.
  2. ncurses based API to render some widgets like
  • command completions
  • history

trajano avatar Dec 26 '23 17:12 trajano