-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Plugin command causes editor display bug #3622
Comments
When you run What you want is a function such as micro's |
I tried using ExecCommand() and RunCommand(), but couldn't get them to deal with shell variables. The code above is the minimum to recreate the bug that I saw. The code below is what I want to do, which is to append the date to a file. It works with os.execute(), but not with shell.ExecCommand() or shell.RunCommand(). And os.execute(), of course, has the problem I showed. Perhaps this is two bugs?
|
If you want to use shell features you can execute it in a shell, eg. shell.RunCommand("sh -c 'cp -v -a main.lua main.lua-$(date +%Y%m%d)'") Of course you could also get the date on the Lua side of things to avoid using a subshell: shell.RunCommand(string.format("cp -v -a main.lua main.lua-%s", os.date("%Y%m%d"))) |
That works. Thank you. |
So this issue can be closed, right? |
Upon execution of the plugin code below, the editor strangely shifts each line as you move through it with the arrow keys. It I remove the "-v" (verbose) option from the copy command the problem goes away. But I do want the results of the execute.
N.B. I'm using micro version 2.0.14.
The text was updated successfully, but these errors were encountered: