Comments (4)
I patched but same error occured..
diff --git a/main.go b/main.go
index a6e5dc8..0056410 100644
--- a/main.go
+++ b/main.go
@@ -414,9 +414,12 @@ func (cfg *config) runfilter(command string, r io.Reader, w io.Writer) error {
func (cfg *config) runcmd(command, pattern string, files ...string) error {
var args []string
for _, file := range files {
- args = append(args, shellquote(file))
+ if strings.ContainsRune(file, ' ') {
+ args = append(args, shellquote(file))
+ }
}
cmdargs := strings.Join(args, " ")
+ fmt.Println(cmdargs)
$ go build
$ .\memo.exe new
Title: hoge
"C:\Users\tsunomur\OneDrive - Microsoft\memo\2020-06-18-hoge.md"
2020/06/18 16:16:40 notepad "C:\Users\tsunomur\OneDrive - Microsoft\memo\2020-06-18-hoge.md"
And when exec "config", it's openend blank notepad. It seem to need shellquote for other case.
Thank you for your cooperation. I'll investigate my situation continually and send PR.
from memo.
Could you pleaes try this?
editor = "notepad ${FILES}"
from memo.
Sorry for my late reply. I tried but it failed.
I've found pattern of sucess.
correct work:
memodir = "C:\\temp"
editor = "notepad"
dosen't work:
memodir = "C:\\Users\\tsunomur\\OneDrive - Microsoft\\memo"
memodir = "C:\\Users\\tsunomur\\OneDrive\\ -\\ Microsoft\\memo"
I used procmon to see this behavior, and then it's try to access C:\"C:\Users\tsunomur\OneDrive - Microsoft\memo\2020-06-18-hoge.md\
from memo.
This memo command spawn executable editor
with cmd /c ...
. So the path contains spaces should be handled to be quoted.
cmd /c notepad "C:\Users\tsunomur\OneDrive - Microsoft\memo"
This quotes does not work when using notepad. Could you please this patch?
diff --git a/main.go b/main.go
index a6e5dc8..1b07ba3 100644
--- a/main.go
+++ b/main.go
@@ -414,7 +414,9 @@ func (cfg *config) runfilter(command string, r io.Reader, w io.Writer) error {
func (cfg *config) runcmd(command, pattern string, files ...string) error {
var args []string
for _, file := range files {
- args = append(args, shellquote(file))
+ if strings.ContainsRune(file, ' ') {
+ args = append(args, shellquote(file))
+ }
}
cmdargs := strings.Join(args, " ")
from memo.
Related Issues (20)
- 初回起動時にvimコマンドが無いと何もできない
- peco HOT 1
- using Ag HOT 1
- GitHub markdown support HOT 4
- create text file
- view memo HOT 3
- Issue created by mistake
- Multiple arguments with `memo delete`
- Installation error when I execute `go get github.com/mattn/memo` HOT 10
- rename memo
- how can i filter results which match also the content of the memo, not only the title? HOT 1
- Install failure HOT 2
- memo delete with selector enabled HOT 1
- `memo grep` won't work well with Select-String on Windows Powershell HOT 2
- some makefile target are out of date in current Go version
- Allow ${HOME} or ~ to specify home in `memodir` config HOT 1
- Transition from `ioutil.ReadFile` to `os.ReadFile` HOT 2
- Add config setting for memo filepath format HOT 7
- Installation fails HOT 3
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 memo.