On copy I get a "\n" after file path. How to fix?
Moderators: Hacker, petermad, Stefan2, white
On copy I get a "\n" after file path. How to fix?
Hi.
i use button to copy path file and get a "\n" after path file, can you fix it? This creates problems when using terminal emulators - connect bot, better terminal emulator, etc
i use button to copy path file and get a "\n" after path file, can you fix it? This creates problems when using terminal emulators - connect bot, better terminal emulator, etc
Last edited by B@ron on 2015-10-08, 09:40 UTC, edited 1 time in total.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Hmm, there is no such command. Or do you mean "121 Copy names to clipboard"? This is for copying selected file names.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I see - all names are indeed separated by line breaks. It's debatable whether there should be a break after the last line or not...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I agree. If one file or folder name copied with one of TC4A copy names commands, TC4A should't add \n because this extra character must be removed then manually each time when pasting it into a New text file or New folder dialog.B@ron wrote:After a single line - noghisler(Author) wrote:I see - all names are indeed separated by line breaks. It's debatable whether there should be a break after the last line or not...after many lines - may be needed
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Re: On copy I get a "\n" after file path. How to fix?
This issue is still relevant. Adding a newline when copying a single full file path creates problems. Can you fix this ? Maybe an additional setting in the options ?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: On copy I get a "\n" after file path. How to fix?
Should I remove the \n at the end just when there is one file, or always?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: On copy I get a "\n" after file path. How to fix?
2ghisler(Author)
Remove \n only for a single line. In other cases some programs may ignore the last line if it's not ended with proper EOL mark (treat incomplete line as unfinished command, broken transmission etc.)
Remove \n only for a single line. In other cases some programs may ignore the last line if it's not ended with proper EOL mark (treat incomplete line as unfinished command, broken transmission etc.)
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: On copy I get a "\n" after file path. How to fix?
Me think "always", if there is one line only or is it the last line of many lines.ghisler(Author) wrote: 2021-08-02, 15:54 UTC Should I remove the \n at the end just when there is one file, or always?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: On copy I get a "\n" after file path. How to fix?
You have a valid point here, so I will do that.some programs may ignore the last line if it's not ended with proper EOL mark
Hopefully they will not ignore single files then...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: On copy I get a "\n" after file path. How to fix?
I apologize for the delay in answering, I did not receive a notification in the mail. Yes, you need to remove it only when copying the name or full path of a single file (functions 121 Copy Names to Clipboard and 122 Full Names to Clipboard).ghisler(Author) wrote: 2021-08-02, 15:54 UTC Should I remove the \n at the end just when there is one file, or always?
A new line after the path when using the copied path in the terminal executes the file, which can cause problems.
When using the file name for the rename, the new line symbol has to be removed because it is written to the filename (on internal storage) :
Code: Select all
ls '/storage/sdcard1/Download/'|grep IMG_20210806_132015.jpg|od -c
0000000 I M G _ 2 0 2 1 0 8 0 6 _ 1 3 2
0000020 0 1 5 . j p g ? \n