<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git, branch main</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>Add a Makefile</title>
<updated>2025-02-04T05:35:51+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2025-02-03T23:58:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=78e37a7fdaaea81f8d9c93170c2adbf9515f6f8c'/>
<id>78e37a7fdaaea81f8d9c93170c2adbf9515f6f8c</id>
<content type='text'>
Most of the commands are simply wrappers around the cargo equivalent.
However, it does include commands to install and uninstall a release
build of the program.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of the commands are simply wrappers around the cargo equivalent.
However, it does include commands to install and uninstall a release
build of the program.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Escape some common special characters</title>
<updated>2025-01-07T06:37:58+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2025-01-06T23:22:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=bfbd5b7e5d2dcf6fde1c44b475ea12f09bc23fdc'/>
<id>bfbd5b7e5d2dcf6fde1c44b475ea12f09bc23fdc</id>
<content type='text'>
In addition to the space character (' '), escape the follow characters
when (path) completion is invoked by the user: #, ', and ".

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In addition to the space character (' '), escape the follow characters
when (path) completion is invoked by the user: #, ', and ".

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Only ignore double slashes after comp was initiated</title>
<updated>2024-12-17T10:15:43+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-12-17T05:53:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2af8e55e87c172d707a728a9739f800048e1ed0a'/>
<id>2af8e55e87c172d707a728a9739f800048e1ed0a</id>
<content type='text'>
This patch changes the check for and removal of a second slash by
enabling it only after the user as initiated completion (i.e. presed Tab
or Shift+Tab). This makes it possible to type two forward slashes (for
instance, when typing or pasting in a URL) without having to go back and
edit the buffer after the fact.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch changes the check for and removal of a second slash by
enabling it only after the user as initiated completion (i.e. presed Tab
or Shift+Tab). This makes it possible to type two forward slashes (for
instance, when typing or pasting in a URL) without having to go back and
edit the buffer after the fact.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update left + right arrow keys, backspace with width fix</title>
<updated>2024-12-17T00:52:34+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-12-17T00:07:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=960b0123ee202aef0cfcd294d56af1713cb91de1'/>
<id>960b0123ee202aef0cfcd294d56af1713cb91de1</id>
<content type='text'>
This patch updates the codepaths of the arrow keys and backspace keys to
calculate the width correctly when moving around in the buffer. See
commit ac5152886fed ("Workaround for faulty unicode_width values") for
more details, or you can also read the large comment at the top of the
new width! macro (which was added to reduce some redundant code, since
we need to properly compute character width in 4 different places).

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch updates the codepaths of the arrow keys and backspace keys to
calculate the width correctly when moving around in the buffer. See
commit ac5152886fed ("Workaround for faulty unicode_width values") for
more details, or you can also read the large comment at the top of the
new width! macro (which was added to reduce some redundant code, since
we need to properly compute character width in 4 different places).

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Workaround for faulty unicode_width values</title>
<updated>2024-12-16T23:03:41+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-12-16T22:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=ac5152886fedc9b65fbb874c67711cd5227d2e00'/>
<id>ac5152886fedc9b65fbb874c67711cd5227d2e00</id>
<content type='text'>
After a bit of analysis work, I believe the unicode_width library is
returning incorrect widths for certain characters (i.e. returning a
width of 0, when the width should be 1). This patch adds a workaround
for that in the comp() function, alongside a long comment documentating
the issue with more resources and tools.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After a bit of analysis work, I believe the unicode_width library is
returning incorrect widths for certain characters (i.e. returning a
width of 0, when the width should be 1). This patch adds a workaround
for that in the comp() function, alongside a long comment documentating
the issue with more resources and tools.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>More buffer bug fixes</title>
<updated>2024-12-13T22:02:16+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-12-13T05:45:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=604b148d94b2b48cf2ad1608b5a2d322e341de3c'/>
<id>604b148d94b2b48cf2ad1608b5a2d322e341de3c</id>
<content type='text'>
Always append a newline to the end of the buffer. This ensures that the
shell will not quit if the user simply presses the return key without
any other input.

Fix a disrepency between the buffer length, and text width in the comp
function. The length of the buffer is the number of indices, whereas the
width of the buffer is the summed width of each character within the
buffer. We need the length when operating on the buffer's indicies, but
the width when dealing with what actually gets outputted to the shell.
In this case, the the width was being used where the length (bpos)
should've been, and was causing an index out of bounds error for any
strings that contained a character wider than 1. This rectifies the
issue, as well as refactors some code that was (appropriately) using the
width.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Always append a newline to the end of the buffer. This ensures that the
shell will not quit if the user simply presses the return key without
any other input.

Fix a disrepency between the buffer length, and text width in the comp
function. The length of the buffer is the number of indices, whereas the
width of the buffer is the summed width of each character within the
buffer. We need the length when operating on the buffer's indicies, but
the width when dealing with what actually gets outputted to the shell.
In this case, the the width was being used where the length (bpos)
should've been, and was causing an index out of bounds error for any
strings that contained a character wider than 1. This rectifies the
issue, as well as refactors some code that was (appropriately) using the
width.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rewrite of the buffer code + proper UTF-8 support</title>
<updated>2024-12-13T01:05:00+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-12-13T00:59:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=fa9ec0c377305126f4c810be198bdca68d71a275'/>
<id>fa9ec0c377305126f4c810be198bdca68d71a275</id>
<content type='text'>
This patch rewrites much of the code in src/buffer.rs to (utlimately),
be less buggy. It also changed getchar() to have proper support for
UTF-8 characters. The autocomplete function was also enhanced to support
completions with filenames that have spaces in their paths. It handles
these by placing a backslash ('\') before each space in the filename.
There is not yet any completion support with quote ('), nor double-quote
characters ("). The buffer is still navigable with arrow keys, so
arbitrary deletions and insertions are still possible. Deletions and
insertions with multi-width UTF-8 characters work as expected.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch rewrites much of the code in src/buffer.rs to (utlimately),
be less buggy. It also changed getchar() to have proper support for
UTF-8 characters. The autocomplete function was also enhanced to support
completions with filenames that have spaces in their paths. It handles
these by placing a backslash ('\') before each space in the filename.
There is not yet any completion support with quote ('), nor double-quote
characters ("). The buffer is still navigable with arrow keys, so
arbitrary deletions and insertions are still possible. Deletions and
insertions with multi-width UTF-8 characters work as expected.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Tab/Shift+Tab autocomplete behavior</title>
<updated>2024-10-01T05:08:20+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-10-01T05:07:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=07e75b3f63001ca509df8d5b5a33336ab994814f'/>
<id>07e75b3f63001ca509df8d5b5a33336ab994814f</id>
<content type='text'>
Previously, switching between Tab and Shift+Tab while cycling through
autocomplete options could temporarily mess up the order of items. This
patch fixes that flaw by adding two new variables to help keep track of
the state:

  - 'last', the last key that was recorded by getchar(),
  - and 'length', which keeps track of the length of the last buffer
    generated by the autocomplete() function.

These variables are then checked first whenever the user uses Tab or
Shift+Tab. The last know buffer 'length' is used to deal with overflow
in the case of Shift+Tab.

Finally, the logic for processing the autocomplete directory was moved
below the code for handling the actual user input (i.e. appending to the
getline() buffer). This is because the last character in the buffer
(i.e. the last character the user typed) is important for properly
updating the autcomplete working directory.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, switching between Tab and Shift+Tab while cycling through
autocomplete options could temporarily mess up the order of items. This
patch fixes that flaw by adding two new variables to help keep track of
the state:

  - 'last', the last key that was recorded by getchar(),
  - and 'length', which keeps track of the length of the last buffer
    generated by the autocomplete() function.

These variables are then checked first whenever the user uses Tab or
Shift+Tab. The last know buffer 'length' is used to deal with overflow
in the case of Shift+Tab.

Finally, the logic for processing the autocomplete directory was moved
below the code for handling the actual user input (i.e. appending to the
getline() buffer). This is because the last character in the buffer
(i.e. the last character the user typed) is important for properly
updating the autcomplete working directory.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add backslashes to words with spaces in autocomplete()</title>
<updated>2024-10-01T05:02:19+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-10-01T03:55:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=41335c1618d3c7c1c5950a228ea15e2d0c3c2d8d'/>
<id>41335c1618d3c7c1c5950a228ea15e2d0c3c2d8d</id>
<content type='text'>
This patch makes it so that the autcomplete() function automatically
inserts the backslash character (`\`) into words with spaces when
cylcing through the options.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes it so that the autcomplete() function automatically
inserts the backslash character (`\`) into words with spaces when
cylcing through the options.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't panic if autcomplete() fails</title>
<updated>2024-10-01T05:02:14+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-10-01T03:55:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=15245cb72d205f967e67518d7cded26ef42ec3a7'/>
<id>15245cb72d205f967e67518d7cded26ef42ec3a7</id>
<content type='text'>
If, for whatever reason, the autocomplete() functions fails, don't panic
and quit. Instead, return an empty string.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If, for whatever reason, the autocomplete() functions fails, don't panic
and quit. Instead, return an empty string.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
</feed>
