Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the0ne/friendly_shell #64

Merged
merged 12 commits into from
Aug 14, 2017

Conversation

the0ne
Copy link
Collaborator

@the0ne the0ne commented Aug 11, 2017

trying to make the shell as convenient to use as possible

Thomas E. Horner added 12 commits August 10, 2017 21:43
... but only if the file extension is .lua (!)

this should be pretty fast even in case of pasting
as no file system access is necessary in that case!
but only if no valid file system is found.

ram (and also the file btw.) can be cleared at any time by calling
os.history(false)
os.history(true)

non-modified commands chosen from history are not stored again.

todo: comment out the syslog lines...
@jolivepetrus
Copy link
Contributor

@the0ne, the reason for remove automatic script executing was explained in 4b2ac83#diff-7bbee87f05384b4f9ded9c0f22bc1b10

  • improvement/shell

The shell scan every line typed by user in the console and try to match the line with a shell command. If the line doesn't match with any valid command, the shell searches in the file system for determine if the user has typed a filename, and if so, it will execute the file.

The previous behavior has a side effect when user copy & paste a script to the console. In this case every pasted line doesn't match with any command, and the shell will test if the line corresponds to a filename. This slows down the script execution, because for each pasted line there is a file system access.

This behavior has been removed, and now, if users wants to execute a lua script they must type the command "do filename".

Not sure about accept your re-added proposal. Thinking about that I have a new solution for this. Automatic script executing maybe needs to prefix the script with the script path, like linux, for example ./my-script.lua or /my-script.lua.

@jolivepetrus jolivepetrus merged commit 097418d into whitecatboard:master Aug 14, 2017
@jolivepetrus
Copy link
Contributor

Please, see 4ccbed7

@the0ne
Copy link
Collaborator Author

the0ne commented Aug 17, 2017

alright, those were mostly for testing anyway 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants