<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git, branch escsq</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 backslashes to words with spaces in autocomplete()</title>
<updated>2024-09-29T06:54:08+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-29T06:54:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=821f8dc319c47da512f0b493fd4fea17546d6509'/>
<id>821f8dc319c47da512f0b493fd4fea17546d6509</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.
</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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Tab/Shift+Tab autocomplete behavior</title>
<updated>2024-09-28T07:09:03+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-28T07:09:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=4f62017709220bbc6d60f51720f13fe1ecb19058'/>
<id>4f62017709220bbc6d60f51720f13fe1ecb19058</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.
</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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't panic if autcomplete() fails</title>
<updated>2024-09-22T03:40:54+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-22T03:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2590315b9e5280ca0c69cce35b4f4bea794790d4'/>
<id>2590315b9e5280ca0c69cce35b4f4bea794790d4</id>
<content type='text'>
If, for whatever reason, the autocomplete() functions fails, don't panic
and quit. Instead, return an empty string.
</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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Expand filepath autocomplete</title>
<updated>2024-09-22T03:05:31+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-22T03:05:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=da7aa5dbeb5e1c98c83fba10648b68962b614353'/>
<id>da7aa5dbeb5e1c98c83fba10648b68962b614353</id>
<content type='text'>
This patch expands upon the last one, by providing a filepath
autcomplete routine, which works more similarly to that of zsh or bash.
It works for:
  - Any paths containing the current directory (`.`)
  - Any paths containing the parent directory (`..`)
  - Any paths containing the root directory (`/`)
  - Any paths that don't contain any explicit directory (defaults to the
    current directory, i.e. `.`)

In order to achieve this, the pwd (present working directory) was broken
out from the autocomplete() function, and is now recomputed every time a
character is typed (in the getline() function). pwd always starts off as
the current directory, but may change based off of user input. If the
current directory cannot be read (likely due to a permissions issue),
dwvsh defaults to the user's home directory for now.

The filepath autocomplete also works for paths with mutliple directories
now (i.e. /etc/mail/xxx), will still allow you to autocomplete files and
directories beginning with 'xxx' inside the '/etc/mail' directory.

It is also possible to use the tilda character (`~`) with the filepath
autocomplete now (it denotes the user's home directory, for instance,
autocomplete works for '~/.config/').

Finally, some logic for Shift+Tab was added to autocomplete. It works
the same as Tab, except runs backwards through the files and directories
(as opposed to forwards).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch expands upon the last one, by providing a filepath
autcomplete routine, which works more similarly to that of zsh or bash.
It works for:
  - Any paths containing the current directory (`.`)
  - Any paths containing the parent directory (`..`)
  - Any paths containing the root directory (`/`)
  - Any paths that don't contain any explicit directory (defaults to the
    current directory, i.e. `.`)

In order to achieve this, the pwd (present working directory) was broken
out from the autocomplete() function, and is now recomputed every time a
character is typed (in the getline() function). pwd always starts off as
the current directory, but may change based off of user input. If the
current directory cannot be read (likely due to a permissions issue),
dwvsh defaults to the user's home directory for now.

The filepath autocomplete also works for paths with mutliple directories
now (i.e. /etc/mail/xxx), will still allow you to autocomplete files and
directories beginning with 'xxx' inside the '/etc/mail' directory.

It is also possible to use the tilda character (`~`) with the filepath
autocomplete now (it denotes the user's home directory, for instance,
autocomplete works for '~/.config/').

Finally, some logic for Shift+Tab was added to autocomplete. It works
the same as Tab, except runs backwards through the files and directories
(as opposed to forwards).
</pre>
</div>
</content>
</entry>
<entry>
<title>Add autocomplete</title>
<updated>2024-09-14T04:38:36+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-14T04:38:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2852f93b714cf8ea83ba7d9aa5d6b138f58ee7e6'/>
<id>2852f93b714cf8ea83ba7d9aa5d6b138f58ee7e6</id>
<content type='text'>
This patch adds a fairly rudimentary form of autocomplete. For starters,
it only works for filepaths, not for programs. Additionally, it
currently only works for the present working directory. You cannot yet
autocomplete even one more level deep.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a fairly rudimentary form of autocomplete. For starters,
it only works for filepaths, not for programs. Additionally, it
currently only works for the present working directory. You cannot yet
autocomplete even one more level deep.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed a bug introduced with termios</title>
<updated>2024-09-12T21:27:08+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-12T21:27:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=fd245ce1561fe5a6e71c5a359436e8ead01a977d'/>
<id>fd245ce1561fe5a6e71c5a359436e8ead01a977d</id>
<content type='text'>
When at the prompt, ICANON and ECHO should be turned off, since all the
output logic is handled via getline()/getchar(). However, they need to
be turned back on (alongside ECHOE, which allows for backspace
characters to work properly with ICANON), in case other programs need to
get user input, their input will echo to the terminal.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When at the prompt, ICANON and ECHO should be turned off, since all the
output logic is handled via getline()/getchar(). However, they need to
be turned back on (alongside ECHOE, which allows for backspace
characters to work properly with ICANON), in case other programs need to
get user input, their input will echo to the terminal.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor Verse::clause()</title>
<updated>2024-09-03T04:36:15+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-03T04:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=51fcf2efdaae8bdd5270cfe64de1522eadd1775f'/>
<id>51fcf2efdaae8bdd5270cfe64de1522eadd1775f</id>
<content type='text'>
There is no reason to return an option for clause(), since it makes us
perform a match twice, and since a blank vector is perfectly acceptable
in all cases where the verse at hand may not have a clause.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no reason to return an option for clause(), since it makes us
perform a match twice, and since a blank vector is perfectly acceptable
in all cases where the verse at hand may not have a clause.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'main' into escsq</title>
<updated>2024-09-01T10:27:00+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-01T10:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=49676c0e1c5fd0660edfd73cfd97001a00b7bd8b'/>
<id>49676c0e1c5fd0660edfd73cfd97001a00b7bd8b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow escaping characters</title>
<updated>2024-09-01T10:24:41+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-01T10:24:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=d03b4643c9c4f85c642182da7a56a613b6f819d4'/>
<id>d03b4643c9c4f85c642182da7a56a613b6f819d4</id>
<content type='text'>
This patch adds the '\' character as a new rune, Rune::Special. This is
for escaping special characters. Also works in strings (", ').
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the '\' character as a new rune, Rune::Special. This is
for escaping special characters. Also works in strings (", ').
</pre>
</div>
</content>
</entry>
<entry>
<title>Slight refactor of getchar() and more handling for getline()</title>
<updated>2024-09-01T10:18:43+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-01T10:18:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=0596517643d9daffa1c4b7b3b0f913ac6d1ab9cd'/>
<id>0596517643d9daffa1c4b7b3b0f913ac6d1ab9cd</id>
<content type='text'>
The getchar() function was changed so that it is able to detect some
ANSI escape sequences. To better handle this, getchar() now returns a
value from the Key enum, indicating whether or not an escape sequence
was found. Currently, the only escape sequences the function deals with
are arrow keys.

Handling of the left and right arrow keys were added to the getline()
function, in order to allow a user to go back and edit their command
inplace. Up and down arrow keys are also handled, but they are just
ignored for now (i.e. they do not move the cursor around anymore). The
local 'pos' variable became an Arc&lt;Mutex&lt;usize&gt;&gt;, since it needs to be
reset to 0 if ctrl-c is pressed (the handler for which is outside the
scope of getline()).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The getchar() function was changed so that it is able to detect some
ANSI escape sequences. To better handle this, getchar() now returns a
value from the Key enum, indicating whether or not an escape sequence
was found. Currently, the only escape sequences the function deals with
are arrow keys.

Handling of the left and right arrow keys were added to the getline()
function, in order to allow a user to go back and edit their command
inplace. Up and down arrow keys are also handled, but they are just
ignored for now (i.e. they do not move the cursor around anymore). The
local 'pos' variable became an Arc&lt;Mutex&lt;usize&gt;&gt;, since it needs to be
reset to 0 if ctrl-c is pressed (the handler for which is outside the
scope of getline()).
</pre>
</div>
</content>
</entry>
</feed>
