Comments (6)
io.popen 是 lua 源代码中的标准函数:
https://github.com/lua/lua/blob/28d829c86712ce5bc453feccc5129a32f78d80c0/liolib.c#L277
你这个版本的 lua 编译的时候没有打开 popen,就是个宏,默认是打开的:
https://github.com/lua/lua/blob/28d829c86712ce5bc453feccc5129a32f78d80c0/liolib.c#L55-L74
请调查一下你的
LUA_USE_POSIX
或者
LUA_USE_LINUX
为什么没有打开?
只要正常编译,这个宏都是打开的,你看我的lua:
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> print(io.popen('pwd'):read('*l'))
/home/skywind
>
from z.lua.
哦,那我重新编译一下。
from z.lua.
https://github.com/lua/lua/blob/4ace93ca6502dd1da38d5c06fa099d229e791ba8/makefile#L56
恩,LUA_USE_LINUX 这个宏再 Makefile 里面默认是开启的,开启后,luaconf.h 中会根据这个宏打开
LUA_USE_POSIX
然后就可以用 popen 了。
https://github.com/lua/lua/blob/4ace93ca6502dd1da38d5c06fa099d229e791ba8/luaconf.h#L61
from z.lua.
发现z.lua如果找不到匹配的路径,就呆在当前路径什么都不做。
可不可以有个这样的功能:当前路径有个目录叫aaa,我知道有这个目录,但是从没有进去过,我执行z aaa
也可以进去。也就是说,如果找不到匹配的路径,就等同于cd。
from z.lua.
恩,修改好了:
export _ZL_MATCH_MODE=1
默认 0 的匹配模式留给默认的原教旨主义匹配法吧,新的匹配法我都挪到 _ZL_MATCH_MODE=1 下面了,包括之前的两个宏都可以省略了。
from z.lua.
嗯, 好了。
from z.lua.
Related Issues (20)
- dirstack shows the frecency rather than index while using powershell HOT 2
- prompt does not show after jump when fzf is enabled HOT 9
- [FR] 当 z 一个文件路径时 cd 到它的目录
- z ~ 存在问题 HOT 5
- _ZL_FZF_FLAG doesn't work
- Weird behavior in Cryptomator vault (FUSE)
- 关于powershell install教程中对profile.ps1文件添加Invoke-Expression时的问题
- .zlua file is always empty HOT 5
- z foo cmd not working HOT 11
- z.lua conflicts with oh-my-posh HOT 1
- lua进程不关闭 HOT 4
- git bash中报错 HOT 1
- 在git bash中报错 HOT 2
- 在mac下的终端zsh安装报错
- z cannot save other drive history in windows HOT 3
- Can z.lua be used with nushell? HOT 1
- Zlua unable to deal with chinese char correctly after setting utf8 encoding in powershell. HOT 1
- z.lua init fail: attempt to concatenate a nil value (local 'path')
- --init show zsh: parse error near `>&' HOT 4
- Can we change the saving path of data file, looks like not support now HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from z.lua.