Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch standard-cli-colors Excluding Merge-Ins
This is equivalent to a diff from 9b263d87c1 to ceee00be59
|
2026-01-11
| ||
| 17:04 | Modify the accordion panel style to hide only vertical overflow and keep the box shadows of selected and current timeline entries visible in the context section of /info pages. Set the CSS property to `clip' instead of `hidden' to disallow any vertical scrolling (for example, by tabbing through hyperlinks), although this is probably not relevant fo... check-in: b0188ce122 user: florian tags: trunk | |
|
2026-01-10
| ||
| 14:17 | Sync with trunk. Leaf check-in: ceee00be59 user: florian tags: standard-cli-colors | |
| 14:10 | Sync with trunk. Leaf check-in: e4556126da user: florian tags: diff-word-wrap | |
| 14:05 | Sync with trunk. Leaf check-in: facfbbd552 user: florian tags: diff-keyboard-navigation | |
| 14:02 | Sync with trunk. check-in: c50c8ed9d7 user: florian tags: timeline-keyboard-navigation | |
| 11:52 | Do not try to use "notepad" as a text editor on non-windows systems. check-in: 9b263d87c1 user: drh tags: trunk | |
|
2026-01-09
| ||
| 16:44 | Update the built-in SQLite to the latest trunk check-in for testing. check-in: 2b2530dd07 user: drh tags: trunk | |
|
2025-11-26
| ||
| 14:16 | Change the `fossil system ls' command to work with the global `--color' option. Like this, colored output on Windows for `--color=auto' (the default if the option is omitted) is only enabled if the terminal supports VT100 escape codes. Additionally, the `NO_COLOR' environment variable allows turning off all colored output. check-in: 07570b15b7 user: florian tags: standard-cli-colors | |
Changes to src/dispatch.c.
| ︙ | ︙ | |||
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 | ** ** Command-line options common to all commands: ** ** --args FILENAME Read additional arguments and options from FILENAME ** --case-sensitive BOOL Set case sensitivity for file names ** --cgitrace Active CGI tracing ** --chdir PATH Change to PATH before performing any operations ** --errorlog FILENAME Log errors to FILENAME ** -?|--help Show help on the command rather than running it ** --httptrace Trace outbound HTTP requests ** --localtime Display times using the local timezone ** --nocgi Do not act as CGI ** --no-th-hook Do not run TH1 hooks ** --quiet Reduce the amount of output | > | 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 | ** ** Command-line options common to all commands: ** ** --args FILENAME Read additional arguments and options from FILENAME ** --case-sensitive BOOL Set case sensitivity for file names ** --cgitrace Active CGI tracing ** --chdir PATH Change to PATH before performing any operations ** --color WHEN Emit VT color escapes: 'never', 'always', or 'auto' ** --errorlog FILENAME Log errors to FILENAME ** -?|--help Show help on the command rather than running it ** --httptrace Trace outbound HTTP requests ** --localtime Display times using the local timezone ** --nocgi Do not act as CGI ** --no-th-hook Do not run TH1 hooks ** --quiet Reduce the amount of output |
| ︙ | ︙ |
Changes to src/main.c.
| ︙ | ︙ | |||
244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# define AUTH_COOKIE 1 /* Authentication by cookie */
# define AUTH_LOCAL 2 /* Uses loopback */
# define AUTH_PW 3 /* Authentication by password */
# define AUTH_ENV 4 /* Authenticated by REMOTE_USER environment var */
# define AUTH_HTTP 5 /* HTTP Basic Authentication */
int isRobot; /* True if the client is definitely a robot. False
** negatives are common for this flag */
int comFmtFlags; /* Zero or more "COMMENT_PRINT_*" bit flags, should be
** accessed through get_comment_format(). */
const char *zSockName; /* Name of the unix-domain socket file */
const char *zSockMode; /* File permissions for unix-domain socket */
const char *zSockOwner; /* Owner, or owner:group for unix-domain socket */
/* Information used to populate the RCVFROM table */
| > > | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# define AUTH_COOKIE 1 /* Authentication by cookie */
# define AUTH_LOCAL 2 /* Uses loopback */
# define AUTH_PW 3 /* Authentication by password */
# define AUTH_ENV 4 /* Authenticated by REMOTE_USER environment var */
# define AUTH_HTTP 5 /* HTTP Basic Authentication */
int isRobot; /* True if the client is definitely a robot. False
** negatives are common for this flag */
int colorOutput; /* Control output of color VT escapes to CLI */
const char *cliColor; /* VT color code for CLI highlight; default: "91" */
int comFmtFlags; /* Zero or more "COMMENT_PRINT_*" bit flags, should be
** accessed through get_comment_format(). */
const char *zSockName; /* Name of the unix-domain socket file */
const char *zSockMode; /* File permissions for unix-domain socket */
const char *zSockOwner; /* Owner, or owner:group for unix-domain socket */
/* Information used to populate the RCVFROM table */
|
| ︙ | ︙ | |||
665 666 667 668 669 670 671 |
}
}
fossil_warning("%s", blob_str(&msg));
blob_reset(&msg);
}
/*
| | > | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 |
}
}
fossil_warning("%s", blob_str(&msg));
blob_reset(&msg);
}
/*
** Initialize the g.comFmtFlags and g.colorOutput global variables.
** Also read the environment variable FOSSIL_COLOR into g.cliColor.
**
** The global command-line options --comfmtflags or --comment-format to
** set the comment format are undocumented and deprecated, and are only
** for backwards compatibility.
**
** If the --color option isn't found, the NO_COLOR environment variable
** may disable colored output (but is otherwise trumped by the option).
*/
static void fossil_init_flags_from_options(void){
char *zEnvVar;
const char *zValue = find_option("comfmtflags", 0, 1);
if( zValue==0 ){
zValue = find_option("comment-format", 0, 1);
}
if( zValue ){
g.comFmtFlags = atoi(zValue);
}else{
g.comFmtFlags = COMMENT_PRINT_UNSET; /* Command-line option not found. */
}
g.colorOutput = COLOR_VT_UNSET;
zValue = find_option("color", 0, 1);
if( zValue ){
if( fossil_strcmp(zValue,"never")==0 ){
g.colorOutput = COLOR_VT_NEVER;
}
else if( fossil_strcmp(zValue,"always")==0 ){
g.colorOutput = COLOR_VT_ALWAYS;
}
else if( fossil_strcmp(zValue,"auto")==0 ){
g.colorOutput = COLOR_VT_AUTO;
}else{
fossil_fatal("the --color option must be 'never', 'always', or 'auto'");
}
}
if( g.colorOutput==COLOR_VT_UNSET ){
zEnvVar = fossil_getenv("NO_COLOR");
if( zEnvVar ){
if( !is_false(zEnvVar) ){
g.colorOutput = COLOR_VT_NEVER;
}
fossil_path_free(zEnvVar);
}
}
g.cliColor = "\033[91m";
zEnvVar = fossil_getenv("FOSSIL_COLOR");
if( zEnvVar ){
if( fossil_strcmp(zEnvVar,"none")==0 ){
if( g.colorOutput==COLOR_VT_UNSET ) g.colorOutput = COLOR_VT_NEVER;
}else{
int i, fValid = 1;
/* Rudimentary sanity check: only allow digits and semicolon. */
for( i=0; zEnvVar[i]; i++ ){
if( !strchr("0123456789;",zEnvVar[i]) ){
fValid = 0;
break;
}
}
if( fValid ) g.cliColor = mprintf("\033[%sm",zEnvVar);
}
fossil_path_free(zEnvVar);
}
}
/*
** Check to see if the Fossil binary contains an appended repository
** file using the appendvfs extension. If so, change command-line arguments
** to cause Fossil to launch with "fossil ui" on that repo.
|
| ︙ | ︙ |
Changes to src/search.c.
| ︙ | ︙ | |||
580 581 582 583 584 585 586 | ** * wiki pages (--wiki) ** * built-in fossil help text (-h) ** * all of the above (-a) ** ** Use options below to select the scope of the search. The ** default is check-in comments only (-c). ** | | | < | < | 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | ** * wiki pages (--wiki) ** * built-in fossil help text (-h) ** * all of the above (-a) ** ** Use options below to select the scope of the search. The ** default is check-in comments only (-c). ** ** Output is colorized if writing to a TTY and neither the "--color" ** option is set to "never", nor the "NO_COLOR" environment variable ** is set to "1". ** ** Options: ** -a|--all Search everything ** -c|--checkins Search check-in comments ** --docs Search embedded documentation ** --forum Search forum posts ** -h|--bi-help Search built-in help ** -n|--limit N Limit output to N matches ** --technotes Search tech notes ** --tickets Search tickets ** -W|--width WIDTH Set display width to WIDTH columns, 0 for ** unlimited. Defaults to the terminal's width. ** --wiki Search wiki */ |
| ︙ | ︙ |
Changes to src/terminal.c.
| ︙ | ︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
/*
** Terminal size defined in terms of columns and lines.
*/
struct TerminalSize {
unsigned int nColumns; /* Number of characters on a single line */
unsigned int nLines; /* Number of lines */
};
#endif
/* Get the current terminal size by calling a system service.
**
** Return 1 on success. This sets the size parameters to the values returned by
** the system call, when such is supported; set the size to zero otherwise.
| > > > > > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
/*
** Terminal size defined in terms of columns and lines.
*/
struct TerminalSize {
unsigned int nColumns; /* Number of characters on a single line */
unsigned int nLines; /* Number of lines */
};
/*
** Values of g.ColorOutput to control output of color VT escapes to CLI.
*/
#define COLOR_VT_UNSET (-1) /* Not initialized. */
#define COLOR_VT_NEVER (0) /* Never emit color VT escapes. */
#define COLOR_VT_ALWAYS (1) /* Always emit color VT escapes. */
#define COLOR_VT_AUTO (2) /* Only emit color VT escapes on terminal. */
#endif
/* Get the current terminal size by calling a system service.
**
** Return 1 on success. This sets the size parameters to the values returned by
** the system call, when such is supported; set the size to zero otherwise.
|
| ︙ | ︙ | |||
127 128 129 130 131 132 133 |
return nDefault;
}
/*
** Return true if it is reasonable is emit VT100 escape codes.
*/
int terminal_is_vt100(void){
| | > > | | | < < | < | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
return nDefault;
}
/*
** Return true if it is reasonable is emit VT100 escape codes.
*/
int terminal_is_vt100(void){
if( g.colorOutput==COLOR_VT_NEVER) return 0;
if( g.colorOutput==COLOR_VT_ALWAYS) return 1;
/* Check the terminal if g.colorOutput is COLOR_VT_UNSET or COLOR_VT_AUTO. */
#ifdef _WIN32
return win32_terminal_is_vt100(1);
#else /* !_WIN32 */
return fossil_isatty(1);
#endif /* !_WIN32 */
return 0;
}
#ifdef _WIN32
/*
** Return true if the Windows console supports VT100 escape codes.
**
|
| ︙ | ︙ |
Changes to src/wikiformat.c.
| ︙ | ︙ | |||
2530 2531 2532 2533 2534 2535 2536 | } } #if INTERFACE /* ** Allowed flag options for html_to_plaintext(). */ | | | | 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 |
}
}
#if INTERFACE
/*
** Allowed flag options for html_to_plaintext().
*/
#define HTOT_VT100 0x01 /* <mark> becomes ^[[<g.cliColor>m */
#define HTOT_FLOW 0x02 /* Collapse internal whitespace to a single space */
#define HTOT_TRIM 0x04 /* Trim off leading and trailing whitespace */
#endif /* INTERFACE */
/*
** Add <MARK> or </MARK> to the output, or similar VT-100 escape
** codes.
*/
static void addMark(Blob *pOut, int mFlags, int isClose){
const char *az[4] = { "<MARK>", "</MARK>", g.cliColor, "\033[0m" };
int i = 0;
if( isClose ) i++;
if( mFlags & HTOT_VT100 ) i += 2;
blob_append(pOut, az[i], -1);
}
/*
|
| ︙ | ︙ |
Changes to src/xsystem.c.
| ︙ | ︙ | |||
357 358 359 360 361 362 363 |
** -S Sort by size, largest first
** -t Sort by mtime, newest first
*/
void xsystem_ls(int argc, char **argv){
int i, rc;
sqlite3 *db;
sqlite3_stmt *pStmt = 0;
| | < < < < < < < < < < < < | | | | | | | | | | | | | < < | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
** -S Sort by size, largest first
** -t Sort by mtime, newest first
*/
void xsystem_ls(int argc, char **argv){
int i, rc;
sqlite3 *db;
sqlite3_stmt *pStmt = 0;
int mFlags = terminal_is_vt100() ? LS_COLOR : 0;
int nFile = 0;
int nDir = 0;
int needBlankLine = 0;
rc = sqlite3_open(":memory:", &db);
if( rc || db==0 ){
fossil_fatal("Cannot open in-memory database");
}
sqlite3_exec(db, "CREATE TABLE ls(fn,mtime,size,mode,dlen);", 0,0,0);
rc = sqlite3_prepare_v2(db, "INSERT INTO ls VALUES(?1,?2,?3,?4,?5)",
-1, &pStmt, 0);
if( rc || db==0 ){
fossil_fatal("Cannot prepare INSERT statement");
}
for(i=1; i<argc; i++){
const char *z = argv[i];
if( z[0]=='-' ){
int k;
for(k=1; z[k]; k++){
switch( z[k] ){
case 'a': mFlags |= LS_ALL; break;
case 'd': mFlags |= LS_DIRONLY; break;
case 'l': mFlags |= LS_LONG; break;
case 'm': mFlags |= LS_COMMA; break;
case 'r': mFlags |= LS_REVERSE; break;
case 'S': mFlags |= LS_SIZE; break;
case 't': mFlags |= LS_MTIME; break;
case 'C': mFlags |= LS_COLUMNS; break;
default: {
fossil_fatal("unknown option: -%c", z[k]);
}
}
}
}else{
if( (mFlags & LS_DIRONLY)==0 && file_isdir(z, ExtFILE)==1 ){
nDir++;
}else{
nFile++;
xsystem_ls_insert(pStmt, z, mFlags);
}
}
}
if( fossil_isatty(1) ){
mFlags |= LS_COLUMNS;
}
if( nFile>0 ){
xsystem_ls_render(db, mFlags);
needBlankLine = 1;
}else if( nDir==0 ){
xsystem_ls_insert(pStmt, ".", mFlags);
|
| ︙ | ︙ |
Changes to www/env-opts.md.
| ︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | most sensible condition. `--cgitrace`: Active CGI tracing. `--chdir DIRECTORY`: Change to the named directory before processing any commands. `--comfmtflags NUMBER`: Specify flags that control how check-in comments and certain other text outputs are formatted for display. The flags are individual bits in `NUMBER`, which must be specified in base 10: * _0_ — Uses the revised algorithm with no special handling. | > > > > > > > > > > > > > | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
most sensible condition.
`--cgitrace`: Active CGI tracing.
`--chdir DIRECTORY`: Change to the named directory before processing
any commands.
`--color WHEN`: Control output of color VT escapes to CLI (supersedes
the `NO_COLOR` environment variable explained later in this document):
* _never_ — Never emit color VT escapes.
* _always_ — Always emit color VT escapes; useful when piping
Fossil command output through a pager utility.
* _auto_ — Only emit color VT escapes when output goes to a
terminal, and not if output is redirected to a pipe, a file, or any
other device.
`--comfmtflags NUMBER`: Specify flags that control how check-in comments
and certain other text outputs are formatted for display. The flags are
individual bits in `NUMBER`, which must be specified in base 10:
* _0_ — Uses the revised algorithm with no special handling.
|
| ︙ | ︙ | |||
130 131 132 133 134 135 136 137 138 139 140 141 142 143 | Overridden by the local or global `editor` setting or the `VISUAL` environment variable. `FOSSIL_BREAK`: If set, an opportunity will be created to attach a debugger to the Fossil process prior to any significant work being performed. `FOSSIL_FORCE_TICKET_MODERATION`: If set, *ALL* changes for tickets will be required to go through moderation (even those performed by the local interactive user via the command line). This can be useful for local (or remote) testing of the moderation subsystem and its impact on the contents and status of tickets. `FOSSIL_FORCE_WIKI_MODERATION`: If set, *ALL* changes for wiki pages | > > > > > | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | Overridden by the local or global `editor` setting or the `VISUAL` environment variable. `FOSSIL_BREAK`: If set, an opportunity will be created to attach a debugger to the Fossil process prior to any significant work being performed. `FOSSIL_COLOR`: Define the color VT escape to highlight CLI text. For example, if set to `1;4`, call-outs are bold and underlined. With the value `none`, colors are disabled, but note that the `--color=always` option takes precedence. The default is `91` (bright foreground red). `FOSSIL_FORCE_TICKET_MODERATION`: If set, *ALL* changes for tickets will be required to go through moderation (even those performed by the local interactive user via the command line). This can be useful for local (or remote) testing of the moderation subsystem and its impact on the contents and status of tickets. `FOSSIL_FORCE_WIKI_MODERATION`: If set, *ALL* changes for wiki pages |
| ︙ | ︙ | |||
228 229 230 231 232 233 234 235 236 237 238 239 240 241 | `LOGNAME`: Name of the logged in user on many Unix-like platforms. Used as the fossil user name if `FOSSIL_USER` is not specified. See the discussion of Fossil Username below for a lot more detail. `NO_COLOR`: If defined and not set to a `false` value (i.e. "off", "no", "false", "0"), the `fossil search` command skips colorization of console output using ANSI escape codes (VT100). `PATH`: Used by most platforms to locate programs invoked without a fully qualified name. Explicitly used by `fossil ui` on certain platforms to choose the browser to launch. `PATH_INFO`: If defined, included in error log messages. | > | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | `LOGNAME`: Name of the logged in user on many Unix-like platforms. Used as the fossil user name if `FOSSIL_USER` is not specified. See the discussion of Fossil Username below for a lot more detail. `NO_COLOR`: If defined and not set to a `false` value (i.e. "off", "no", "false", "0"), the `fossil search` command skips colorization of console output using ANSI escape codes (VT100). Note the `--color` option takes precedence over the `NO_COLOR` variable. `PATH`: Used by most platforms to locate programs invoked without a fully qualified name. Explicitly used by `fossil ui` on certain platforms to choose the browser to launch. `PATH_INFO`: If defined, included in error log messages. |
| ︙ | ︙ |