mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
Merge pull request #3688 from laloch/env-hostname
Add $HOSTNAME and $HOSTTYPE environment variables
This commit is contained in:
commit
1df65ee369
2 changed files with 38 additions and 1 deletions
23
news/env-hostname.rst
Normal file
23
news/env-hostname.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* Added ``$HOSTNAME`` and ``$HOSTTYPE`` environment variables.
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -12,6 +12,7 @@ import contextlib
|
|||
import collections
|
||||
import collections.abc as cabc
|
||||
import subprocess
|
||||
import platform
|
||||
|
||||
from xonsh import __version__ as XONSH_VERSION
|
||||
from xonsh.lazyasd import LazyObject, lazyobject
|
||||
|
@ -87,7 +88,6 @@ from xonsh.ansi_colors import (
|
|||
)
|
||||
import xonsh.prompt.base as prompt
|
||||
|
||||
|
||||
events.doc(
|
||||
"on_envvar_new",
|
||||
"""
|
||||
|
@ -942,6 +942,20 @@ def DEFAULT_VARS():
|
|||
"Note: ``erasedups`` is supported only in sqlite backend).",
|
||||
doc_store_as_str=True,
|
||||
),
|
||||
"HOSTNAME": Var(
|
||||
is_string,
|
||||
ensure_string,
|
||||
ensure_string,
|
||||
default_value(lambda env: platform.node()),
|
||||
"Automatically set to the name of the current host.",
|
||||
),
|
||||
"HOSTTYPE": Var(
|
||||
is_string,
|
||||
ensure_string,
|
||||
ensure_string,
|
||||
default_value(lambda env: platform.machine()),
|
||||
"Automatically set to a string that fully describes the system type on which xonsh is executing.",
|
||||
),
|
||||
"IGNOREEOF": Var(
|
||||
is_bool,
|
||||
to_bool,
|
||||
|
|
Loading…
Add table
Reference in a new issue