<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git, branch signal</title>
<subtitle>a (mostly) posix compliant shell and tiny functional programming language
</subtitle>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/'/>
<entry>
<title>Replace ctrlc with signal-hook</title>
<updated>2024-02-25T04:24:19+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-25T04:24:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=b6fc81066cfcc29d4519191eae5ba19581ad2774'/>
<id>b6fc81066cfcc29d4519191eae5ba19581ad2774</id>
<content type='text'>
Replaced the 'ctrlc' crate with 'signal-hook' for handling of SIGINT.
The 'signal_hook::low_level::register' function is actually unsafe.
However, according to
https://docs.rs/signal-hook/latest/signal_hook/low_level/fn.register.html,
it is only unsafe in the case of multithreaded applications. There are
some race conditions as well. For instance, it appears that even when we
fork to a child process, SIGINT is captured on both that process, as
well as the shell.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced the 'ctrlc' crate with 'signal-hook' for handling of SIGINT.
The 'signal_hook::low_level::register' function is actually unsafe.
However, according to
https://docs.rs/signal-hook/latest/signal_hook/low_level/fn.register.html,
it is only unsafe in the case of multithreaded applications. There are
some race conditions as well. For instance, it appears that even when we
fork to a child process, SIGINT is captured on both that process, as
well as the shell.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reorganization and comments</title>
<updated>2024-02-23T06:12:24+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-23T06:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=536e250653e5c140a6d9e60f1cd652b79135e7a6'/>
<id>536e250653e5c140a6d9e60f1cd652b79135e7a6</id>
<content type='text'>
Broke out the structs for a poem into their own file: src/recite.rs.
Also put the 'prefresh' function into it's own file: src/recite/path.rs.
Commented most of the parser code (including structs and helper methods
related to parsing (i.e. Verse, Stanza, Meter, Poem)). Renamed any
instance of the 'paths' variable to 'path'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Broke out the structs for a poem into their own file: src/recite.rs.
Also put the 'prefresh' function into it's own file: src/recite/path.rs.
Commented most of the parser code (including structs and helper methods
related to parsing (i.e. Verse, Stanza, Meter, Poem)). Renamed any
instance of the 'paths' variable to 'path'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add back the 'cd' command</title>
<updated>2024-02-21T06:18:42+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-21T06:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=a14fdf8faa85628baf06399961eb1f9ab4c5f3eb'/>
<id>a14fdf8faa85628baf06399961eb1f9ab4c5f3eb</id>
<content type='text'>
Add back change directory functionality into the new parser.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add back change directory functionality into the new parser.
</pre>
</div>
</content>
</entry>
<entry>
<title>Parsing improvements</title>
<updated>2024-02-20T23:29:29+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T23:29:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=309a101a0e09ffe2bcd4f0032744f8532a5988d1'/>
<id>309a101a0e09ffe2bcd4f0032744f8532a5988d1</id>
<content type='text'>
Now the parser goes char by char, since special characters like '|' and
'&amp;' don't necessarily have to be whitespace seperated. Also added some
VERY basic error detection for the parser (revolving around special
chars).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now the parser goes char by char, since special characters like '|' and
'&amp;' don't necessarily have to be whitespace seperated. Also added some
VERY basic error detection for the parser (revolving around special
chars).
</pre>
</div>
</content>
</entry>
<entry>
<title>Pipes, forks, and consecutive calls</title>
<updated>2024-02-20T09:49:20+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T09:49:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=5d7e3646b7a267bdcf068d5667201033b3aa9207'/>
<id>5d7e3646b7a267bdcf068d5667201033b3aa9207</id>
<content type='text'>
This adds some preliminary support for pipes (|), forks (&amp;), and
consecutive command calls (&amp;&amp;) to the shell.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds some preliminary support for pipes (|), forks (&amp;), and
consecutive command calls (&amp;&amp;) to the shell.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only print command name in error messages</title>
<updated>2024-02-20T00:45:14+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T00:45:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=de2fe9dd7f2836f89490b822ae4464dab3bc769c'/>
<id>de2fe9dd7f2836f89490b822ae4464dab3bc769c</id>
<content type='text'>
Only print out the command name in error messages, rather than printing
out the full path to the command.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only print out the command name in error messages, rather than printing
out the full path to the command.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #2 from pinecat/evryloop</title>
<updated>2024-02-20T00:29:54+00:00</updated>
<author>
<name>Rory D</name>
</author>
<published>2024-02-20T00:29:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=52422d40316f4d836a96a15709c2f4fad7c96d3b'/>
<id>52422d40316f4d836a96a15709c2f4fad7c96d3b</id>
<content type='text'>
Path refresh</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Path refresh</pre>
</div>
</content>
</entry>
<entry>
<title>Path refresh refactor, comments, and error messages</title>
<updated>2024-02-20T00:09:07+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T00:09:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=d98ab111eebfcf5e6327daaec17b5de578d64a41'/>
<id>d98ab111eebfcf5e6327daaec17b5de578d64a41</id>
<content type='text'>
The 'eval' function was renamed to 'repl'.

The code to refresh the $PATH was moved into it's own function:
'prefresh', and is now being called in three locations:
  - At the beginning of 'repl', before the main loop
  - Inside the main loop, possibly during a path search if the command
    is not initially found
  - Inside the main loop, if the call to Command::spawn() throws an
    error, and the error is ErrorKind::NotFound

Doc comments were added for each function, as well as a few more
comments throughout that detail the program's control flow.

The error messages in the main repl loop were cleaned up to have a more
consistent style, and to provide more/better detail.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 'eval' function was renamed to 'repl'.

The code to refresh the $PATH was moved into it's own function:
'prefresh', and is now being called in three locations:
  - At the beginning of 'repl', before the main loop
  - Inside the main loop, possibly during a path search if the command
    is not initially found
  - Inside the main loop, if the call to Command::spawn() throws an
    error, and the error is ErrorKind::NotFound

Doc comments were added for each function, as well as a few more
comments throughout that detail the program's control flow.

The error messages in the main repl loop were cleaned up to have a more
consistent style, and to provide more/better detail.
</pre>
</div>
</content>
</entry>
<entry>
<title>Better handling of errors during the fork</title>
<updated>2024-02-19T09:33:36+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-19T09:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=08be85a2fc508450c6361af4ef38a7dcd3efbde5'/>
<id>08be85a2fc508450c6361af4ef38a7dcd3efbde5</id>
<content type='text'>
Adds two additional error checks when the shell forks:
1. Checks for permission (+r, +x)
2. Checks if the file exists

The first error may occur if the user does not have read access to the
file, or if the file is not executable. The second error may occur if a
file was removed from the $PATH, and the $PATH hasn't been refreshed
yet.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds two additional error checks when the shell forks:
1. Checks for permission (+r, +x)
2. Checks if the file exists

The first error may occur if the user does not have read access to the
file, or if the file is not executable. The second error may occur if a
file was removed from the $PATH, and the $PATH hasn't been refreshed
yet.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refresh path only if command is not found</title>
<updated>2024-02-19T08:40:58+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-19T08:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2e5cc53499947c32b01ea5e1787ed505bc286969'/>
<id>2e5cc53499947c32b01ea5e1787ed505bc286969</id>
<content type='text'>
This is a modified implementation of the 'refresh path on every
iteration of the loop' idea. It instead, only refreshes the path if the
command is not found. After the first refresh, if the command still is
not found, it throws and error.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a modified implementation of the 'refresh path on every
iteration of the loop' idea. It instead, only refreshes the path if the
command is not found. After the first refresh, if the command still is
not found, it throws and error.
</pre>
</div>
</content>
</entry>
</feed>
