Closed Taitava closed 2 years ago
Fixed. I'll release a beta4
soon.
AMAZING!!!!!!!!!
beta4
is now released: https://github.com/Taitava/obsidian-shellcommands/releases/tag/0.7.0-beta4
@FelipeRearden can you confirm here that newlines work now? Just one thing that I've learned about the echo
command on Bash: I needed to add an -e
parameter to the command, otherwise newlines appear as \n
in the output. So a complete example command: echo -e {{clipboard}}
, and another: echo -e {{selection}}
.
As you have Zsh instead of Bash, I do not know if your echo
works differently.
beta4
is now released: https://github.com/Taitava/obsidian-shellcommands/releases/tag/0.7.0-beta4
Thank you very much @Taitava !!!! :)
@FelipeRearden can you confirm here that newlines work now? Just one thing that I've learned about the
echo
command on Bash: I needed to add an-e
parameter to the command, otherwise newlines appear as\n
in the output. So a complete example command:echo -e {{clipboard}}
, and another:echo -e {{selection}}
.
Sure @Taitava !!! I will test and get back to you.
I have some chores and errands to do today but tomorrow morning I will concentrate in testing beta 4 :)
As you have Zsh instead of Bash, I do not know if your
echo
works differently.
I'm gonna test echo
, echo -e
and printf
too. Thanks for the tip :)
Should I test everything ({{path_}}) or focus only on {{clipboard}} and {{selection}} ?
Should I take a look at data_backup.json
or not?
Thanks!!!!!
I have some chores and errands to do today but tomorrow morning I will concentrate in testing beta 4 :)
- Sorry for not testing beta 4 now :)
Take your time! π I don't have any time expectations. Even if I sometimes happen to do stuff fast and post a lot, I don't expect others to react immediately π. I can wait. We all have our timetables.
As you have Zsh instead of Bash, I do not know if your
echo
works differently.I'm gonna test
echo
,echo -e
andprintf
too. Thanks for the tip :)
Good ideas!
Question for @Taitava about testing beta 4
Should I test everything ({{path_}}) or focus only on {{clipboard}} and {{selection}} ?
Should I take a look at
data_backup.json
or not?Thanks!!!!!
If it's not too much work, you could test all your variable tests just in case, although {{clipboard}}
and {{selection}}
are the most important. No need to test backup files, I believe it works solidly now.
Thank you a lot! You are helping a lot! π
Take your time! π I don't have any time expectations. Even if I sometimes happen to do stuff fast and post a lot, I don't expect others to react immediately π. I can wait. We all have our timetables
Thanks @Taitava !! For SC I always want to concentrate 100% when testing because I know that we need to be very calm to don't make a mistake and prepare a good explanation if I find something that I judge as wrong ;)
If it's not too much work, you could test all your variable tests just in case, although {{clipboard}} and {{selection}} are the most important. No need to test backup files, I believe it works solidly now.
No problem at all @Taitava !!! I go for full test tomorrow:)
Thanks we talk tomorrow!!!!!!!
Take your time! π I don't have any time expectations. Even if I sometimes happen to do stuff fast and post a lot, I don't expect others to react immediately π. I can wait. We all have our timetables
Thanks @Taitava !! For SC I always want to concentrate 100% when testing because I know that we need to be very calm to don't make a mistake and prepare a good explanation if I find something that I judge as wrong ;)
That's also true! "Postponing" something for a bit later, peaceful time, can be more respectful than trying to do something quickly and in a hurry. Waiting is not always a bad thing. π
If it's not too much work, you could test all your variable tests just in case, although {{clipboard}} and {{selection}} are the most important. No need to test backup files, I believe it works solidly now.
No problem at all @Taitava !!! I go for full test tomorrow:)
Thanks we talk tomorrow!!!!!!!
Thank you! π
Working perfect on version 0.7.0-beta4
Obsidian 0.12.19
More details about the test here in #96
Thank you very much for this fix @Taitava !!!!!!!
Really nice to know! π
Example:
echo {{clipboard}}
, make sure the output is either a notification balloon, or current file.On Windows PowerShell, the test works ok, the newline characters are preserved in the output. But on Bash and Zsh (latter tested by @FelipeRearden on Mac, I tested Bash on Linux), the newline characters disappear.
I think it happens because these Bourne family shells consider an escaped newline to mean something like "continue this command in the next line", i.e. just ignore the newline character, pretend it never existed. This is just my guessing, and I can't say for certain that this is how these shells really think.
I need to make the escaping system to do the following:
\n
. A shell will later convert it back to it's original meaning.\r
. A shell will later convert it back to it's original meaning.\r\n
(used on Windows). While Windows PowerShell does not suffer from this bug, I think it's simpler to do this replacing for PowerShell too, as it will be more streamlined when newline replacing is the same for all shells. The escape characterEdit: no, this would not work for PowerShell, so there will be no changes regarding PowerShell. π But in case a variable happens to output a carriage return & newline pair on Mac/Linux (if file content happens to have one), this will still give a literal\
will of course be different for PowerShell (`
), i.e.\r\n
will actually be`r`n
. According to this source, this should work for PowerShell.\r\n
.Edit: Actually, it seems that I need to double the escape character, so
\n
will become\\n
. Otherwiseecho -e
on Bash will output a literaln
instead of a newline.