Since this is not the most important app, I expect progress to have a
more relaxed pace, so here are some fixes in the meantime:
1) Get hold of `unicorn-cal` from the AUR in an Arch-based distribution.
It relies solely on libc and the differences are so insignificant here
that it can be copied over without any issues. This just works, and
colors and .cal.dat files work as well. Downside: It has no i18n
support, so you are out of luck if you want your months with local
names. This is the origin of `ccal`, unchanged since 2014-06-21.
Or you could build it yourself on Ubuntu, which is (for me) more
difficult on a Debian-based system.
2) Instead of `ccal`, use `ccal | awk '{ gsub(/\r/, "");
gsub(/[0-9][0-9];[0-9][0-9]m/, "\033[0;" "&");
gsub(/\033\[0;3[0-9];4[37]m/, "\033[0m"); print }'`. Use it as a
function in your `.bash_functions` (if you have it) or `.bashrc` file:
```
fcal() {
ccal "$@" | awk '{ gsub(/\r/, ""); gsub(/[0-9][0-9];[0-9][0-9]m/, "\033[0;"
"&"); gsub(/\033\[0;3[0-9];4[37]m/, "\033[0m"); print }'
}
```
This works with l18n and a .cal.dat file, but not with colors. `ccal`
refuses to send color codes if the output is anything other than a
terminal.
To achieve all three, you need to use [this script from a Unix
Stackexchange answer](https://unix.stackexchange.com/a/564841) to let
`ccal` think its output goes to a pty. Copy the script, change the first
line to `#!/usr/bin/env python3` and save it in `~/bin` or
`/usr/local/bin`. I named it `fpty` for 'force pty'. It is also attached
to this post.
Then, you can have a second function:
```
fccal() {
fpty ccal "$@" | awk '{ gsub(/\r/, ""); gsub(/[0-9][0-9];[0-9][0-9]m/,
"\033[0;" "&"); gsub(/\033\[0;3[0-9];4[37]m/, "\033[0m"); print }'
}
```
which gives the original `cal` or `ccal` functionality, including
colors, localization (some non-ASCII quirks from the original source)
and .cal.dat files.
All credit for this goes to [François
Tonneau](https://github.com/ftonneau) who adapted his [`calcol`
script](https://github.com/ftonneau/calcol) to fix the issue.
** Attachment added: "helper script to force `ccal` to use colors"
https://bugs.launchpad.net/ubuntu/+source/cal/+bug/2097279/+attachment/5881570/+files/fpty
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2097279
Title:
ccal does not display properly
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cal/+bug/2097279/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs