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

Separate args to fasd --proc. #10

Merged
merged 1 commit into from
Sep 19, 2016
Merged

Separate args to fasd --proc. #10

merged 1 commit into from
Sep 19, 2016

Conversation

elmisback
Copy link
Collaborator

Briefly: right now, fasd isn't tracking files.

Why?

"fasd --proc expects arguments to be passed in separately, but subshells in fish are implicitly quoted".

Solution (not perfect)

We can solve this for most cases by splitting on spaces.

Discussed here; solution down here.

@elmisback elmisback changed the title Separates args to fasd --proc. Separate args to fasd --proc. Sep 17, 2016
@simnalamburt
Copy link
Collaborator

Looks like it's hard problem to solve perfectly. Thanks you for your report. I didn't even know that such problem does exist.

@simnalamburt simnalamburt merged commit 67ee290 into oh-my-fish:master Sep 19, 2016
@nhooyr
Copy link

nhooyr commented Feb 20, 2017

We don't need to split on \n because fasd --sanitize joins all newlines together anyway. E.g. something like

like try fasd --sanitize (echo -e 'ls -l "izi\nmonieslol\nds"')

you don't get

ls -l "izi
monieslol
ds"

you get ls -l "izi monieslol ds". So there should be no newlines to split on.

So string split ' ' should work fine.

@elmisback
Copy link
Collaborator Author

Let me know if I'm misunderstanding your concern, but I believe the pull request splits the output on spaces as you suggest (it's just using tr instead of string split).

@nhooyr
Copy link

nhooyr commented Feb 20, 2017

But it also splits on newlines, which is unnecessary.

@elmisback
Copy link
Collaborator Author

tr -s ' ' \n only translates spaces into newlines. AFAIK it's equivalent to string split ' '. Do you think fasd --proc is receiving incorrect input?

@nhooyr
Copy link

nhooyr commented Feb 20, 2017

OH, I MISREAD, sorry for the noise.

@elmisback
Copy link
Collaborator Author

No problem!

@nhooyr nhooyr mentioned this pull request Feb 20, 2017
paradox460 added a commit to paradox460/fasd that referenced this pull request Feb 28, 2017
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.

3 participants