Open ourarash opened 5 years ago
Due to a regression, currently stdin doesn't work to set termux-notification's content (#271).
However, multiline still doesn't work:
#doesn't work
termux-notification --content "line 1\nline 2"
#also doesn't work
termux-notification --content "line 1
line 2"
Any chance this will be fixed?
Thanks for reporting! Fixed in version 0.44 of the termux-api package.
Thanks for fixing! How does the multiline work now? Does it need \n
or will it wrap automatically?
Also, when will this version be available on google Play?
Thanks for fixing! How does the multiline work now? Does it need
\n
or will it wrap automatically?
Just tested and:
...
\n
doesn't work. Did it work? (is it a regression?)termux-notification -c 'hello
world'
Also, when will this version be available on google Play?
termux-api-package
does not end up in google play; just pkg up
in termux to update it
\n doesn't work. Did it work? (is it a regression?)
Just \n
will not work unless it is parsed and replaced with newline character.
[xeffyr]:~:$ echo "a\nb"
a\nb
[xeffyr]:~:$ echo -e "a\nb"
a
b
[xeffyr]:~:$
Whoops, sorry, I was referring to the argument to --content
and had forgotten about stdin entirely.
So termux-notification --content 'a\nb'
won't work, but echo -e 'a\nb' | termux-notification
will.
\n
doesn't work. Did it work? (is it a regression?)- actually embedding a newline in the string works. i.e.
It now works. I call it from a node script. I used it in my package stock-crypto-monitor to show a multi-line notification. Thanks for the fix!
"\n" works, but auto-wrap still don't.
Confirmed; reopening
Edit to clarify: the feature that's missing is auto-wrapping of long lines ( termux-notification -c 'lorem ipsum dolor sit amet lorem ipsum dolor sit amet'
), while multiline notifications work if the user specifies where the line break should be.
You can do like this if you want to print next line.
termux-notification --content "$(echo -e "line1\nline2")"
Problem description Termux notifications cuts the line and doesn't show strings that don't fit in a line. Using
\n
or piping to stdin as recommended here doesn't work either. In fact it looks like the piped value is ignored.Steps to reproduce
Expected behavior Wrap the strings that don't fit in a single line.
Additional information Non-rooted device. Galaxy Note 8.
The below image shows the of the above command results on my device.