Git Product home page Git Product logo

hilbish's People

Contributors

angelofallars avatar crumbtoo avatar devins2518 avatar freddson avatar heavyrain266 avatar javacafe01 avatar jdugan6240 avatar jimt avatar l3afme avatar legendofmiracles avatar mcotocel avatar perospirone avatar ratogabriel avatar renzix avatar superpowers04 avatar torchedsammy avatar willeccles avatar ym1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hilbish's Issues

ci: add better/more useful checks

the title is pretty clear as day. right about now, the only type of ci or github actions is the semantic check for pr titles/commit messages and a compile on commit. i dont have an idea of useful ci, but i just thought to put the idea out

feat: windows support

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

feat: args variable

when ran as a shebang or whatever hilbish should provide the args variable
as what is somewhat obvious this will be an array of arguments the user provides
if no args, it will be nil

feat: ^^ to run previous command

^^ should be used to run the previous command, so that for people lazy to copy paste when they have to add anything new to the command (example set a env variable then run command)

Failing to compile on Artix

Using Artix Linux with Linux 5.11.6

$ go build main.go
# command-line-arguments
./main.go:95:38: undefined: hshprompt
$ echo $?
2

Am I missing something?

fix: lunacolors not found in nix-shell

/home/devin/.hilbishrc.lua:2: module lunacolors not found:
        no field package.preload['lunacolors']
        stat ./lunacolors.lua: no such file or directory
        stat /usr/local/share/lua/5.1/lunacolors.lua: no such file or directory
        stat /usr/local/share/lua/5.1/lunacolors/init.lua: no such file or directory
        stat ./libs/lunacolors/init.lua: no such file or directory
        stat ./lunacolors/init.lua: no such file or directory
        stat ./lunacolors/lunacolors.lua: no such file or directory
        stat /usr/share/hilbish/libs/lunacolors/init.lua: no such file or directory
        stat : no such file or directory
        stat /usr/share/hilbish/libs/lunacolors/lunacolors.lua: no such file or directory
        stat /home/devin/.local/share/hilbish/libs/lunacolors/init.lua: no such file or directory
        stat /home/devin/.local/share/hilbish/libs/lunacolors/lunacolors.lua: no such file or directory
        stat /home/devin/.local/share/hilbish/libs/lunacolors.lua: no such file or directory,
stack traceback:
        [G]: in function 'require'
        /home/devin/.hilbishrc.lua:2: in main chunk
        [G]: ?
An error has occured while loading your config! Falling back to minimal default config.

feat: deeper command complete

currently the most depth of something that can be completed is 3.
in the example of git, git <command> <flag/file>. users should be able to do more than that configurable via lua function

fix: use lua.CheckType instead of lua.ToType

for hilbish's lua functions written in go and accepting arguments, lua.CheckType should be used where Type is the type of the argument

for example:

str := lua.ToString(1)
// should be replaced with
str := lua.CheckString(1)

this will automatically raise a lua error if the arg isn't provided or is the incorrect type, which is why for optional args this should not be changed and should remain lua.ToType

feat: function to append to path

for lua there should be a convenient appendPath function and as the name suggests, will add the provided directory to the $PATH

basically there's no need to do

os.setenv('PATH', os.getenv 'PATH' .. ':/my/path:/home/' .. os.getenv 'USER' .. '/bin')

instead one can do

appendPath('/my/path', '~/bin')

improve readme

i think that the readme could have more pizzazz, including some thing like screenshots, badgets and just make it nicer and more attractive

not a tty

running tty in hilbish will say that it's not a tty. this also means that top doesnt work, and htop, other shells and hilbish itself exit immediately when trying to open

ive tried opening a pty and while it has worked (tty shows the pts device) running hilbish in itself still isnt optimal and top cant be exited from

feat: expose mvdan.cc/sh/v3/shell to hilbish

exactly as the title says, the 2 functions it provides should be available in the hilbish lua api for use. this would be convenient, for example, enhancing the builtin cd command even more, and other things

feat: aliases interface

a hilbish.aliases interface which will have functions which relate to aliasing

  • list() - #86
  • add(name, command) - same as the current alias function
  • delete(name) - removes an alias

fix: not returning exit code causes panic

i was testing petals, and oh look! a panic

the source is this line here. since petals (formerly, ill fix it there) doesnt return an exit code, it causes that call to panic
a simple fix would be to check if luaexitcode is nil, and if it is don't try to pop, since nothing has been returned
or the pop can just go in the if call right below it, probably

fix: reuse sh runner instance

on every command, we create a new sh runner to execute our sh. this is a little bit inefficient. if a global runner was used,
it would hold old declared env variables, and shell scripts would be able to be sourced

better documentation

having to write then by hand is pretty annoying, and i'd have no idea how to make generated docs for lua or go

feat: signal hooks

would allow a hilbish script to catch certain signals and act on them (like having a clean exit for ctrl+c)

  • SIGINT (ctrl c)
  • SIGWINCH (resize)
  • SIGKILL cant be caught

feat: showing lua variables and tables by default

to explain: if someone wants to print a lua variable, theyll obviously have to use the print function. but this is a bit of a hassle.
and if u want to look at a lua table, that gets more complicated.
instead, someone should be able to just type var here, like os.getenv 'PATH' and it prints it just like that, and for tables to print it with keys and values in json style

fix: dont add duplicate dirs visited

currently all directories visited including duplicates are added to the recentDirs table which makes cdr have duplicate dirs. the dir should not be added if its the most recent

act as login shell

there should be an option for hilbish to act like other login shells where it loads an additional rc file (dont know what this is/will be though)

feat: cd - to go to previous dir

cd - should use the $OLDPWD env variable to cd to the old directory
how this should be handled is either:

  1. fs.cd() should store the old pwd to that env variable, then actually change the directory. then we check in lua if arg == '-', and if it is then fs.cd(os.getenv 'OLDPWD')
  2. the other case being the function itself handles changing to old pwd if fs.cd '-' is used

relevant files to change are:
in case 1, golibs/fs/fs.go and preload.lua
in case 2 only ^

feat: cd command supporting env variables

currently, hilbish's built in version of cd is very primitive, it just accepts a single argument as the entire directory. what would be cool though, is making env variables work
so people can do something like:

cd $NVM_DIR

would cd to the directory for nvm, as an example.

feat: make certain variables compile time changable

to explain:
to support more systems/environments (like nixos i guess and termux) we should set certain paths/other things to be normal variables instead of being hardcoded. these can then be changed with the -X link flag, as shown in the makefile

fix: dont append dir to path if its already there

appendPath exists, it is a very useful function that simply appends a dir to the $PATH env variable
problem (not really a problem but yknow): it will always append, no matter if it's already in $PATH
so, the function should check if its provided directory is already in the path. if not, append. if it is there, do nothing

feat: hilbish std expansion

more functions and vars to hilbish!!
if anyone wishes to do any amount of these, just say so

fs

  • stat(path)
    • it's already made but some improvements can be done to it
  • readdir(path)

ansikit

  • link(text, url) -- makes a hyperlink (info here)
  • cursorPos()
  • wrap(text, cols) -- wraps text ๐Ÿ‘

table

  • map(tbl, fn)
  • filter(fbl, fn)
  • reduce(tbl, fn)

os

  • name
  • version

feat: increment $SHLVL

the $SHLVL variable is a handy one for finding out how deep a person is in shells. it's pretty useful for me, where im constantly switching between unstable and stable hilbish versions. but it doesnt increment the $SHLVL, so itll stay at its default value (3, for me)

Makefile does not respect DESTDIR

Hi, I'm the AUR maintainer for this package. I believe @MCotocel had asked earlier if I could start building this with the Makefile instead of directly invoking go build, however, the Makefile in question doesn't seem to respect whatever DESTDIR is set to. This is important for Arch Linux, as packages are not allowed to directly install to /usr/bin without using pacman.

This is what I get from an unreleased hilbish PKGBUILD, using the latest release:

make: Warning: File 'Makefile' has modification time 5828 s in the future
'hilbish' -> '/usr/bin/hilbish'
install: cannot create regular file '/usr/bin/hilbish': Permission denied
make: *** [Makefile:9: install] Error 1
A failure occurred in package().
Aborting...

And this is what I have in the PKGBUILD:

package() {
  cd "$pkgname-$pkgver"
  DESTDIR="$pkgdir/" make install

DESTDIR is set to $pkgdir, which expands to the package directory. So ideally it should install to $pkgdir/usr/bin/hilbish

proposal: multiline hook

i'm proposing to anyone reading this for a multiline hook.
this hook will be thrown anytime the user goes into multiline mode, and will have a type argument to say whether its a user continued line (line here \) or incomplete sh input

feat: doc command

doc is simple: it will serve as in shell documentation for hilbish functions and fields
example:

-> doc commander

commander: Command handler for hilbish

register(cmdname, callback) - Registers a command with the name of `cmdname` which runs the `callback` when exeucuted
deregister(cmdname) - Removes a commander-registered command

could be expanded/look better possibly

feat: history interface

the history interface (hilbish.history) will be the place to view and/or manipulate and interface with the hilbish command history.

Functions

  • size(): get the size of the history
  • add(): add text to history
  • clear(): clears history
  • all(): retrieves all the commands in history
  • get(n): gets the nth command in history

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.