<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/main.c, branch v2.5.2</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>UNIX: do not automatically restart syscalls on SIGINT</title>
<updated>2026-04-18T22:02:16+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-04-18T22:02:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=d4c864e92f89003e73883fe0b259e6c2e3bfb4f3'/>
<id>d4c864e92f89003e73883fe0b259e6c2e3bfb4f3</id>
<content type='text'>
* signal() sets SA_RESTART by default.
* Some syscalls can theoretically block indefinitely.
  Even opening a special file could result in an indefinitely
  blocking operation, that should be interruptible.
  You must still poll teco_interrupted in these read() loops of course.
* Also makes sure that clipboard operations are interruptible
  even if $SCITECO_CLIPBOARD_GET blocks.
  Although I couldn't provoke problems in practice,
  I did observe hangs with xclip on Wayland on Linux,
  that could only be resolved by manually killing xclip.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* signal() sets SA_RESTART by default.
* Some syscalls can theoretically block indefinitely.
  Even opening a special file could result in an indefinitely
  blocking operation, that should be interruptible.
  You must still poll teco_interrupted in these read() loops of course.
* Also makes sure that clipboard operations are interruptible
  even if $SCITECO_CLIPBOARD_GET blocks.
  Although I couldn't provoke problems in practice,
  I did observe hangs with xclip on Wayland on Linux,
  that could only be resolved by manually killing xclip.
</pre>
</div>
</content>
</entry>
<entry>
<title>GTK: SIGTERM/SIGHUP always terminates the program and dumps recovery files</title>
<updated>2026-04-12T21:00:40+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-04-12T19:47:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=0a8770ac7d382df8976b2448fccc6cfe434cd4d1'/>
<id>0a8770ac7d382df8976b2448fccc6cfe434cd4d1</id>
<content type='text'>
* SIGTERM used to insert the ^KCLOSE key macro.
  However with the default ^KCLOSE macro, which inserts `EX`,
  this may fail to terminate the editor if buffers are modified.
  If the process is consequently killed by a non-ignorable signal,
  we may still loose data.
* SIGTERM is used to gracefully shut down, so we now always terminate.
  Since we have recovery files, they are now dumped before terminating.
  This makes sure that recovery files are more up-to-date during
  unexpected but gracefull terminations.
* The same functionality is planned on Curses, but requires more fundamental
  changes (TODO).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* SIGTERM used to insert the ^KCLOSE key macro.
  However with the default ^KCLOSE macro, which inserts `EX`,
  this may fail to terminate the editor if buffers are modified.
  If the process is consequently killed by a non-ignorable signal,
  we may still loose data.
* SIGTERM is used to gracefully shut down, so we now always terminate.
  Since we have recovery files, they are now dumped before terminating.
  This makes sure that recovery files are more up-to-date during
  unexpected but gracefull terminations.
* The same functionality is planned on Curses, but requires more fundamental
  changes (TODO).
</pre>
</div>
</content>
</entry>
<entry>
<title>DEBUG_PAUSE in main.c now works on any system with a standard libc</title>
<updated>2026-02-05T23:05:32+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-02-05T23:05:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=43085563697bda1757e8576566d80ade129f5ae2'/>
<id>43085563697bda1757e8576566d80ade129f5ae2</id>
<content type='text'>
It's also sometimes useful on UNIX, e.g. when there is no gdbserver.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's also sometimes useful on UNIX, e.g. when there is no gdbserver.
</pre>
</div>
</content>
</entry>
<entry>
<title>GTK: fixed --detach and support stdout/stderr redirections</title>
<updated>2026-01-24T15:37:27+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-01-24T15:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=7ff541040edc3b3f8a25bb69e04ecb57cba12954'/>
<id>7ff541040edc3b3f8a25bb69e04ecb57cba12954</id>
<content type='text'>
* We fork after command line arguments have been parsed, which
  is after gtk_get_option_group() has been called.
  This means that GTK was already initialized and it wasn't safe
  to continue after forking.
* As a workaround, we now re-exec with the original argv array,
  so GTK can be properly reinitialized.
  Since we did not remove `--detach` from argv (and that would be
  nontrivial), it would fork again endlessly,
  so we use an environment variable
  $__SCITECO_DETACHED to guard against recursive forks.
* Also, do not close stdin/stdout/stderr if has been redirected
  to a file, so you can now e.g. call `gsciteco -d &gt;some-file`.
* This was broken since v2.5.0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* We fork after command line arguments have been parsed, which
  is after gtk_get_option_group() has been called.
  This means that GTK was already initialized and it wasn't safe
  to continue after forking.
* As a workaround, we now re-exec with the original argv array,
  so GTK can be properly reinitialized.
  Since we did not remove `--detach` from argv (and that would be
  nontrivial), it would fork again endlessly,
  so we use an environment variable
  $__SCITECO_DETACHED to guard against recursive forks.
* Also, do not close stdin/stdout/stderr if has been redirected
  to a file, so you can now e.g. call `gsciteco -d &gt;some-file`.
* This was broken since v2.5.0.
</pre>
</div>
</content>
</entry>
<entry>
<title>updated copyright to 2026</title>
<updated>2026-01-01T06:59:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-01-01T06:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c2feb2a6f71fc9adb20226fb3c2260c236e974e0'/>
<id>c2feb2a6f71fc9adb20226fb3c2260c236e974e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>the command line macro is now managed by a Scintilla view</title>
<updated>2025-11-08T12:00:47+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-11-07T20:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=4e6ddd6c329d56055a732c6344df019f0d997aaf'/>
<id>4e6ddd6c329d56055a732c6344df019f0d997aaf</id>
<content type='text'>
* Instead of rendering a teco_string_t into a Scintilla view (GTK)
  and an ncurses window (Curses), it is now a Scintilla view and document
  that is modified directly.
* Reduces redundancies between GTK and Curses UIs.
* It will be more efficient on very large command lines, especially on GTK.
* We can now redirect Scintilla messages to the command line view in order
  to configure syntax highlighting, the margin, rubout indicator style and
  scroll behavior (TODO).
* This will also simplify the configuration of multi-line command lines (TODO).
* Since INDIC_PLAIN is not supported by Scinterm, rubbed out command lines
  are now styled with INDIC_STRAIGHTBOX (background color).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Instead of rendering a teco_string_t into a Scintilla view (GTK)
  and an ncurses window (Curses), it is now a Scintilla view and document
  that is modified directly.
* Reduces redundancies between GTK and Curses UIs.
* It will be more efficient on very large command lines, especially on GTK.
* We can now redirect Scintilla messages to the command line view in order
  to configure syntax highlighting, the margin, rubout indicator style and
  scroll behavior (TODO).
* This will also simplify the configuration of multi-line command lines (TODO).
* Since INDIC_PLAIN is not supported by Scinterm, rubbed out command lines
  are now styled with INDIC_STRAIGHTBOX (background color).
</pre>
</div>
</content>
</entry>
<entry>
<title>mention both mailing list and personal mail in `sciteco --help`</title>
<updated>2025-10-01T14:15:50+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-09-29T00:17:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=cfaea44f475b7425cc45bec05ef6f58f41d98321'/>
<id>cfaea44f475b7425cc45bec05ef6f58f41d98321</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Win32: avoid any automatic LF to CRLF conversions when writing to stdout</title>
<updated>2025-08-09T16:45:56+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-08-09T16:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=acae72517bc892911bf9b0f261ef41356e7e2c44'/>
<id>acae72517bc892911bf9b0f261ef41356e7e2c44</id>
<content type='text'>
* At least the MSVCRT does this by default, i.e. the translation mode of stdout
  is not _O_BINARY.
* This broke piping through SciTECO with --stdin --stdout, as this relies on SciTECO's
  builtin EOL normalization. Instead, you would get DOS linebreaks on output even if the
  source stream contains only UNIX linebreaks.
* It would also break binary filters.
* It seems to be safe to print only LF also for regular stdio (help and error messages),
  so I simply disaply the stdout (and stdin and stderr) EOL translation globally.
* Also fixes Troff warnings due to the .in preprocessor writing output with DOS linebreaks.
* Added a test case. All future platforms shouldn't perform any unexpected EOL translations
  on output.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* At least the MSVCRT does this by default, i.e. the translation mode of stdout
  is not _O_BINARY.
* This broke piping through SciTECO with --stdin --stdout, as this relies on SciTECO's
  builtin EOL normalization. Instead, you would get DOS linebreaks on output even if the
  source stream contains only UNIX linebreaks.
* It would also break binary filters.
* It seems to be safe to print only LF also for regular stdio (help and error messages),
  so I simply disaply the stdout (and stdin and stderr) EOL translation globally.
* Also fixes Troff warnings due to the .in preprocessor writing output with DOS linebreaks.
* Added a test case. All future platforms shouldn't perform any unexpected EOL translations
  on output.
</pre>
</div>
</content>
</entry>
<entry>
<title>command-line arguments are no longer passed via the unnamed buffer, but via special Q-registers ^Ax</title>
<updated>2025-08-06T13:46:37+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-08-06T13:46:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=280cb9da39fc7b5357f6071926d511394f6d0152'/>
<id>280cb9da39fc7b5357f6071926d511394f6d0152</id>
<content type='text'>
* The unnamed buffer is also used for reading from --stdin, so you couldn't practically combine
  --stdin with passing command-line arguments to macros.
* The old approach of passing command-line arguments via lines in the
  unnamed buffer was flawed anyway as it wouldn't work with filenames containing LF.
  This is just a very ancient feature, written when there weren't even long Q-reg names in SciTECO.
* You can now e.g. pipe into SciTECO and edit what was read interactively, e.g. `dmesg | sciteco -i`.
  You can practically use SciTECO as a pager.
* htbl.tes is now a command-line filter (uses -qio).
* grosciteco.tes reads Troff intermediate code from stdin, so we no longer need
  "*.intermediate" temporary files.
* added a getopt.tes test case to the testsuite.
* This change unfortunately breaks most macros accepting command-line arguments,
  even if they used getopt.tes.
  It also requires updating ~/.teco_ini - see fallback.teco_ini.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The unnamed buffer is also used for reading from --stdin, so you couldn't practically combine
  --stdin with passing command-line arguments to macros.
* The old approach of passing command-line arguments via lines in the
  unnamed buffer was flawed anyway as it wouldn't work with filenames containing LF.
  This is just a very ancient feature, written when there weren't even long Q-reg names in SciTECO.
* You can now e.g. pipe into SciTECO and edit what was read interactively, e.g. `dmesg | sciteco -i`.
  You can practically use SciTECO as a pager.
* htbl.tes is now a command-line filter (uses -qio).
* grosciteco.tes reads Troff intermediate code from stdin, so we no longer need
  "*.intermediate" temporary files.
* added a getopt.tes test case to the testsuite.
* This change unfortunately breaks most macros accepting command-line arguments,
  even if they used getopt.tes.
  It also requires updating ~/.teco_ini - see fallback.teco_ini.
</pre>
</div>
</content>
</entry>
<entry>
<title>added --quiet, --stdin and --stdout for easier integration into UNIX pipelines</title>
<updated>2025-08-03T13:09:33+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-08-03T12:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=51bd183f064d0c0ea5e0184d9f6b6b62e5c01e50'/>
<id>51bd183f064d0c0ea5e0184d9f6b6b62e5c01e50</id>
<content type='text'>
* In principle --stdin and --stdout could have been done in pure TECO code using the
  &lt;^T&gt; command.
  Having built-in command-line arguments however has several advantages:
  * Significantly faster than reading byte-wise with ^T.
  * Performs EOL normalization unless specifying --8bit of course.
  * Significantly shortens command-lines.
    `sciteco -qio` and `sciteco -qi` can be real replacements for sed and awk.
* You can even place SciTECO into the middle of a pipeline while editing
  interactively:
  foo | sciteco -qio --no-profile | bar
  Unfortunately, this will not currently work when munging the profile
  as command-line parameters are also transmitted via the unnamed buffer.
  This should be changed to use special Q-registers (FIXME).
* --quiet can help to improve the test suite (TODO).
  Should probably be the default in TE_CHECK().
* --stdin and --stdout allow to simplify many SciTECO scripts, avoiding
  temporary files, especially for womenpage generation (TODO).
* For processing potentially infinite streams, you will still have to
  read using ^T.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* In principle --stdin and --stdout could have been done in pure TECO code using the
  &lt;^T&gt; command.
  Having built-in command-line arguments however has several advantages:
  * Significantly faster than reading byte-wise with ^T.
  * Performs EOL normalization unless specifying --8bit of course.
  * Significantly shortens command-lines.
    `sciteco -qio` and `sciteco -qi` can be real replacements for sed and awk.
* You can even place SciTECO into the middle of a pipeline while editing
  interactively:
  foo | sciteco -qio --no-profile | bar
  Unfortunately, this will not currently work when munging the profile
  as command-line parameters are also transmitted via the unnamed buffer.
  This should be changed to use special Q-registers (FIXME).
* --quiet can help to improve the test suite (TODO).
  Should probably be the default in TE_CHECK().
* --stdin and --stdout allow to simplify many SciTECO scripts, avoiding
  temporary files, especially for womenpage generation (TODO).
* For processing potentially infinite streams, you will still have to
  read using ^T.
</pre>
</div>
</content>
</entry>
</feed>
