Rosettea / Hilbish

🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨
https://rosettea.github.io/Hilbish/
MIT License
506 stars 22 forks source link

feat: windows support #17

Closed TorchedSammy closed 2 years ago

TorchedSammy commented 3 years ago

hilbish isnt tested on windows, since i don't have an install of it and don't want to bother getting it just to test. the only problems seem to be the readline library dependency and hardcoded linux paths

devins2518 commented 3 years ago

Go on windows is pretty cancer, and the readline lib is pretty unit specific. No promises, but I’ll experiment with getting it to build at least. Are there any ways to branch code based on platform in go?

also golang :kek:

TorchedSammy commented 3 years ago

Are there any ways to branch code based on platform in go

you can have build constraints which means a file will only be built if its for platform there's also runtime.GOOS so you can do os check at runtime

devins2518 commented 3 years ago

So current options for a platform readline lib: https://github.com/chzyer/readline: seemingly very low level, pita to implement existing stuffs, completions will be hell (maybe mooch off preexisting completion methods?), possibility to make something pretty good with enough work https://github.com/lmorg/readline: seemingly limited api, seems to be crossplatform but doesn't show any examples I think the first one would be a better choice, but then again i would need to learn golang

TorchedSammy commented 3 years ago

the second has an example here: https://github.com/lmorg/readline/tree/master/examples/01-getting-started i think this would be a better choice, i already considered 1st in the past while doing v0.1 and yeah completions will be hell

devins2518 commented 3 years ago

i meant examples of cross platform stuff, but im guessing it does from the file names. Ill try to work this into the existing stuff so we dont give up any functionality

TorchedSammy commented 3 years ago

tab complete doesn't complete the line unless the user presses enter might as well just make a custom line editor

devins2518 commented 3 years ago

I thought this provided tab completions? https://github.com/lmorg/readline/blob/master/tab.go

TorchedSammy commented 3 years ago

tab -> get entry -> hit enter

devins2518 commented 3 years ago

jesus christ

TorchedSammy commented 3 years ago

milestone hell to get this on track again, hilbish itself already works fine on windows (i added some windows specific checks, runtime paths, etc) but all that is missing is an accessible and good line editor.

i realized that readline is also gpl so moving away from that completely would be great and a pure go library means cross compile and faster compiles. prevously mentioned libraries dont work for us (or any i found) so seems only option is to roll our own

TorchedSammy commented 2 years ago

expected to come with the 0.8 release which will change to the pure go readline library

TorchedSammy commented 2 years ago

will close for 1.0

TorchedSammy commented 2 years ago

finally