micro icon indicating copy to clipboard operation
micro copied to clipboard

Calling clipboard.Write in lua crashes micro

Open Neko-Box-Coder opened this issue 1 year ago • 6 comments

Description of the problem or steps to reproduce

When calling clipboard.Write with anything inside a lua script, it just crashes micro.

Example code:

local clipboard = import("micro/clipboard")
-- ...
clipboard.Write("Test", -1)

Crash trace:

bindings.json
Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:261 (0x4571f8)
runtime/panic.go:260 (0x4571c6)
github.com/yuin/[email protected]/table.go:316 (0x7d658c)
github.com/yuin/[email protected]/state.go:1245 (0x7d6595)
github.com/yuin/[email protected]/vm.go:413 (0x7ea0e5)
github.com/yuin/[email protected]/vm.go:31 (0x7e70a5)
github.com/yuin/[email protected]/state.go:1202 (0x7d605c)
github.com/yuin/[email protected]/state.go:836 (0x7ff905)
layeh.com/[email protected]/luar.go:265 (0x7fff18)
github.com/zyedidia/micro/v2/internal/action/command.go:1050 (0x8d3b23)
github.com/zyedidia/micro/v2/internal/action/actions.go:1603 (0x8c35c9)
github.com/zyedidia/micro/v2/internal/info/infobuffer.go:162 (0x892923)
github.com/zyedidia/micro/v2/internal/action/infopane.go:227 (0x8d7e5f)
github.com/zyedidia/micro/v2/internal/action/infopane.go:54 (0x8d6fb1)
github.com/zyedidia/micro/v2/internal/action/infopane.go:136 (0x8d784f)
github.com/zyedidia/micro/v2/internal/action/infopane.go:95 (0x8d745e)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:478 (0x90fba6)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:397 (0x90f4af)
runtime/internal/atomic/types.go:194 (0x44111d)
runtime/asm_amd64.s:1695 (0x4754e1)

If you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues

Specifications

Commit hash: e9bd1b35 OS: Linux Terminal: WezTerm

Neko-Box-Coder avatar May 27 '24 07:05 Neko-Box-Coder

Hi, the select input will do search if you type alpha-numerical keys (just like the native select HTML element.)

For more complex search, we're leaving it to community prompts for now since it usually comes with more complex and different requirements.

SBoudrias avatar Jun 28 '24 13:06 SBoudrias

Also, of interest, proposal to add a search prompt to the core https://github.com/SBoudrias/Inquirer.js/pull/1479

SBoudrias avatar Jul 20 '24 20:07 SBoudrias

select input will do search if you type alpha-numerical keys (just like the native select HTML element.)

Which version is this added in? I am not seeing this behaviour on the latest version.

moltar avatar Sep 17 '24 14:09 moltar

Here's the specific release https://github.com/SBoudrias/Inquirer.js/commit/c91196e66689cfc05e9237763e6f95f3eb5342a1 - and also included in inquirer@>10.

SBoudrias avatar Sep 17 '24 14:09 SBoudrias