diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit f7bf182c743257b4faf92f0f3fed5d4fe4d21812
parent ef7b3ea342515a951edd2ef08a1c62eeea693d0f
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Sat, 11 Dec 2021 21:06:32 +0100

pty documentation

Diffstat:
MREADME.md | 2+-
Mman1/diary.1 | 9++++++---
Msrc/diary.c | 2+-
3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -122,7 +122,7 @@ The file `${XDG_CONFIG_HOME:-~/.config}/diary/diary.cfg` should adhere to a basi | `--editor` or `-e` | `editor` | vim | (empty) | Editor to open journal files with. If unset, defaults to environment variable `$EDITOR`. If no editor is provided, the diary is opened read-only. | | `--fmt` or `-f` | `fmt` | %d_%b_%y | %Y-%m-%d | Date format and file name for the files inside the `dir`. For the format specifiers, see [`man strftime`](https://man7.org/linux/man-pages/man3/strftime.3.html). Be careful: If you change this, you might no longer find your existing diary entries, because the diary assumes to find the journal files under another file name. Hence, a change in FMT shows an empty diary, at first. Rename all files in the DIARY_DIR to migrate to a new FMT. | | `--fmt-cmd` or `-F` | `fmt_cmd` | `fmt -w75 -s` or `mdcat -c` | (empty) | Journal entries are formatted with this command. If not set (default), the characters are printed to the preview screen character by character (without word wrap). For example, to enable word wrap after 75 characters, use "fmt -s" as FMT_CMD. | -| `--no-pty` or `-p` | `no_pty` | `true` | false (0) | No pseudo terminal (pty) for entry preview. If set to true (1), journal entries are displayed with Ncurses. If set to false (0), the entry preview is printed to a pseudo terminal (pty) and not processed with Ncurses. | +| `--no-pty` or `-p` | `no_pty` | `true` | false (or 0) | No pseudo terminal (pty) for entry preview. Only effective in combination with `--fmt-cmd`. If set to true (or 1), the output of `--fmt-cmd` is displayed with Ncurses. If set to false (or 0), the result of `--fmt-cmd` (journal entry preview) is printed on a pseudo-terminal (pty) and not processed with Ncurses. The pty supports the ANSI escape sequences (e.g. colors, font types, etc.) of the native terminal. | | `--range` or `-r` | `range` | 10 | 1 | Number of years to show before/after todays date | | `--weekday` or `-w` | `weekday` | 0 | 1 | First weekday, `7` = Sunday, `1` = Monday, ..., `6` = Saturday. Use `7` (or `0`) to display week beginning at Sunday ("S-M-T-W-T-F-S"), or `1` for "M-T-W-T-F-S-S". If `glibc` is installed, the first day of the week is derived from the current locale setting (`$LANG`, see `man locale`). Without `glibc`, the first weekday defaults to 1 (Monday), unless specified otherwise with this option. | | n/a | `google_calendar` | diary | (empty) | Displayname of Google Calendar for [CalDAV sync](#CalDAV-sync) | diff --git a/man1/diary.1 b/man1/diary.1 @@ -40,9 +40,12 @@ the characters are printed to the preview screen character by character use "fmt -s" as FMT_CMD. To format markdown, use "mdcat -c" or similar. .TP \fB\-p\fR, \fB\-\-no-pty\fR -No pseudo terminal (pty) for entry preview. If set, journal entries are -displayed with Ncurses. If not set (default), the entry preview is printed -to a pseudo terminal (pty) and not processed with Ncurses. +No pseudo terminal (pty) for entry preview. Only effective in combination +with \fB--fmt-cmd\fR. If set, the output of \fB--fmt-cmd\fR is displayed +with Ncurses. If not set (default), the result of \fB--fmt-cmd\fR (journal +entry preview) is printed on a pseudo-terminal (pty) and not processed with +Ncurses. The pty supports the ANSI escape sequences (e.g. colors, font types, +etc.) of the native terminal. .TP \fB\-r\fR, \fB\-\-range\fR=\fI\,RANGE\/\fR RANGE is the number of years to show before/after todays date. Defaults to 1 year. diff --git a/src/diary.c b/src/diary.c @@ -383,7 +383,7 @@ void usage() { printf(" -e, --editor EDITOR : Editor to open journal files with\n"); printf(" -f, --fmt FMT : Date and file format, change with care\n"); printf(" -F, --fmt-cmd FMT_CMD : Format entry preview with command FMT_CMD\n"); - printf(" -p, --no-pty : No pseudo terminal (pty) for entry preview\n"); + printf(" -p, --no-pty : Result of FMT_CMD not printed to pty but processed within Ncurses\n"); printf(" -r, --range RANGE : RANGE is the number of years to show before/after today's date\n"); printf(" -w, --weekday DAY : First day of the week, 0 = Sun, 1 = Mon, ..., 6 = Sat\n"); printf("\n");