-
Notifications
You must be signed in to change notification settings - Fork 328
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
newline "\n" in file names: how to handle them? #433
Comments
@marcosrdac Have you tried changing If you ask me, I would simply drop to shell and handle those files the good old way, and then whine about people using newline characters in filenames. |
Oh, thank you very much @gokcehan, I was naïve thinking that I still remembered these kind of details from your precise documentation. The problem was solved by changing filesep to '\r'. |
@gokcehan Apologies for raising an old issue. I use a command to delete many selected files. My problem when using
If one of these files has a newline in it...what have I done? Who have I deleted? I don't know. I don't use filenames with newlines in them. I dearly hope never to -- but if I ever run into one and don't notice, this design makes it very easy to shoot myself in the foot. I cannot trust this command. I will not run it on a visual mode selection, because newline-named files could be hanging around somewhere in the dirs, like landmines. In a prior issue, you stated that it doesn't make sense to make this functionality newline-compatible when the rest of The more narrow use case of "passing file lists to commands", however, seems to be a lot more well trodden. Most of us have no desire to bookmark, jump to, mark, or list a newline-named file in Let another program take care of these problematic files -- just give When I pass arguments to a shell script, I automatically get
|
@yashlala Shell command arguments are already in use though. Try this:
This was already proposed and discussed in the prior issue you mentioned. |
I'm aware of this functionality, it's done well. But this does not help my use case of mass file removal, because I don't believe it's possible to use this functionality in a mapping. I'm proposing that when a mapping is run, the currently selected items should be passed to the command.
Now, Regarding Issue #1114 (which I believe is the issue you mentioned -- please LMK if this isn't it): I believe the discussion there ended with your (rightly) saying:
The use case presented above (file removal) is important to me. I believe making the selected items available |
@yashlala Shell command arguments are also available for mappings as well. Try this:
So what are we supposed to do with these arguments? |
Shell command arguments are fine -- I'm proposing passing the currently selection as arguments. Ie:
Now, when I select entries (via something like |
Hi, I'm having some troble managing files that happened to have the escape character '\n'. If I select multiple files (with those problematic ones in selection too) I can't run a script that used "$fs" properly. It breaks the file into two filenames and then my script fails to be run (as those 2 files do not exist, in my example.
I have tried changing the value of ifs via
but everything gets even messier this way. I also tried to set IFS from inside the command I create, but I get no good results too.
Do you have any tips that I could use to solve this problem?
Already grateful!
The text was updated successfully, but these errors were encountered: