<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/slave.h, branch 1.21.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.21.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.21.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2024-01-11T15:37:17Z</updated>
<entry>
<title>slave: don't skip setting environment variables when using a custom environment</title>
<updated>2024-01-11T15:37:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-01-09T15:50:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9da7152f834384a354710fcc8f99a6f83e5dfc12'/>
<id>urn:sha1:9da7152f834384a354710fcc8f99a6f83e5dfc12</id>
<content type='text'>
When launching footclient with -E,--client-environment the environment
variables that should be set by foot, wasn't.

Those variables are:

* TERM
* COLORTERM
* PWD
* SHELL

and all variables defined by the user in the [environment] section in
foot.ini.

In the same way, we did not *unset* TERM_PROGRAM and
TERM_PROGRAM_VERSION.

This patch fixes it by "cloning" the custom environment, making it
mutable, and then adding/removing the variables above from it.

Instead of calling setenv()/unsetenv() directly, we add the wrapper
functions add_to_env() and del_from_env().

When *not* using a custom environment, they simply call
setenv()/unsetenv().

When we *are* using a custom environment, add_to_env() first loops all
existing variables, looking for a match. If a match is found, it's
updated with the new value. If it's not found, a new entry is added.

del_from_env() loops all entries, and removes it when a match is
found. If no match is found, nothing is done.

The mutable environment is allocated on the heap, but never free:d. We
don't need to free it, since it's only allocated after forking, in the
child process.

Closes #1568
</content>
</entry>
<entry>
<title>config: add a new ‘environment’ section</title>
<updated>2022-06-13T09:55:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-05-28T17:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=755f96321ab47f931d11680027d47d1d772f5584'/>
<id>urn:sha1:755f96321ab47f931d11680027d47d1d772f5584</id>
<content type='text'>
This section allows the user to define custom environment variables to
be set in the child process:

  [environment]
  name=value
</content>
</entry>
<entry>
<title>client: add -E,--client-environment</title>
<updated>2022-04-12T13:07:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-11T10:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d02124902b4e27c3ed3ef48442ce17c5e0af9d56'/>
<id>urn:sha1:d02124902b4e27c3ed3ef48442ce17c5e0af9d56</id>
<content type='text'>
When this option is used, the child process in the new terminal
instance will inherit its environment from the footclient process,
instead of the foot server’s.

Implemented by sending (yet another) dynamic string list as part of
the client -&gt; server setup packet. When the new option is *not* used,
the setup packet is now 2 bytes larger than before.

On the server side, the slave process now uses execvpe() instead of
execvp(). There’s plumbing to propagate a new ‘envp’ argument from
term_init() all the way down to slave_exec(). If ‘envp’ is NULL, we
use ‘environ’ instead (thus matching the old behavior of execvp()).

Closes #1004
</content>
</entry>
<entry>
<title>user-notification: 'productify' the user-warning system</title>
<updated>2020-07-30T16:58:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-30T16:57:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f6533a71e4996f2f4cd45336966cebf6c3f34b1e'/>
<id>urn:sha1:f6533a71e4996f2f4cd45336966cebf6c3f34b1e</id>
<content type='text'>
* Rename user_warning to user_notification
* Add warning and error types (in addition to the existing deprecated)
* Simplify logic when emitting a user notification after forking; we
  don't need to copy the notification data since we're in a new
  process and have total control over that memory.
</content>
</entry>
<entry>
<title>term: add capability to print warnings *inside* the terminal</title>
<updated>2020-07-29T17:42:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-29T17:42:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b3d0215c388c51a7e9838d16fe06023844af5c8b'/>
<id>urn:sha1:b3d0215c388c51a7e9838d16fe06023844af5c8b</id>
<content type='text'>
This is intended to be used to print e.g. deprecation warnings inside
the terminal, *before* the shell is started.
</content>
</entry>
<entry>
<title>slave: prefix argv[0] with a '-' when spawning a login-shell</title>
<updated>2020-02-20T17:36:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-02-20T17:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b5efe984bbfec151b70d3450f4f18243313de497'/>
<id>urn:sha1:b5efe984bbfec151b70d3450f4f18243313de497</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: term_init: add 'cwd' argument</title>
<updated>2019-12-21T18:57:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-21T18:57:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=39146fac5cb7db4d0b68ba685722ca4713ddf722'/>
<id>urn:sha1:39146fac5cb7db4d0b68ba685722ca4713ddf722</id>
<content type='text'>
This is used when spawning the slave, to set its current working
directory just before we exec() the client.

In a regular foot instance, we set the cwd from getcwd().

In a foot server instance, each connecting client sends its cwd to the
server, and we use that.
</content>
</entry>
<entry>
<title>slave: set TERM environment variable in slave process</title>
<updated>2019-11-01T20:01:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-01T20:01:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=69d62d3cd2918bee089fc879e381820349497483'/>
<id>urn:sha1:69d62d3cd2918bee089fc879e381820349497483</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: move client startup to a new function, slave_spawn()</title>
<updated>2019-10-30T17:05:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-30T17:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=18921f7f45db38a9393992e4dd26a8046117a8a6'/>
<id>urn:sha1:18921f7f45db38a9393992e4dd26a8046117a8a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>slave: rename slave_spawn() -&gt; slave_exec()</title>
<updated>2019-10-30T16:30:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-28T17:53:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ce5f5e4d51d693933cb7193ccce2c19d4feac79c'/>
<id>urn:sha1:ce5f5e4d51d693933cb7193ccce2c19d4feac79c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main: allow user to override shell on the command line</title>
<updated>2019-07-17T07:55:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-17T07:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c11cc2be5736ccd509d2f452ee83e1217a699835'/>
<id>urn:sha1:c11cc2be5736ccd509d2f452ee83e1217a699835</id>
<content type='text'>
</content>
</entry>
<entry>
<title>slave: report exec() failure back to main process</title>
<updated>2019-07-17T07:39:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-17T07:39:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=aa87be43ba0deb9977a7c159367214afbe7a50b4'/>
<id>urn:sha1:aa87be43ba0deb9977a7c159367214afbe7a50b4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>slave: exec shell from conf</title>
<updated>2019-07-17T07:30:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-17T07:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=153894eb73a26b912d5dc0581f93b3527244cf12'/>
<id>urn:sha1:153894eb73a26b912d5dc0581f93b3527244cf12</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Set up pseudo terminal and fork slave</title>
<updated>2019-06-13T13:19:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-06-13T13:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=acda4d2d315b16d0cf37755a3f9add4e49eb7514'/>
<id>urn:sha1:acda4d2d315b16d0cf37755a3f9add4e49eb7514</id>
<content type='text'>
</content>
</entry>
</feed>
