aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/hostname.fish
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <glitchmr@myopera.com>2013-08-12 09:56:03 +0300
committerGravatar Konrad Borowski <glitchmr@myopera.com>2013-08-12 09:56:03 +0300
commit64921fe08a35aedc2715471b45b78d583660ddb7 (patch)
treeafb0aee85f810888017315c05bf0b788649656fe /share/functions/hostname.fish
parent79d5ff03502b779fde4994ab65dd22c049d8125b (diff)
Fix hostname command under Cygwin with Unicode characters
Yes, hostname is broken under Cygwin, but for fish it's an issue, as it makes fish_config more buggy than it needs to be (by making UTF-8 errors according to Python).
Diffstat (limited to 'share/functions/hostname.fish')
-rw-r--r--share/functions/hostname.fish8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/functions/hostname.fish b/share/functions/hostname.fish
new file mode 100644
index 00000000..eb667ef8
--- /dev/null
+++ b/share/functions/hostname.fish
@@ -0,0 +1,8 @@
+# Query for USERDOMAIN to shorten waiting times when OS isn't Windows.
+if set -q USERDOMAIN; and test (uname -o) = Cygwin
+ # Cygwin's hostname is broken when computer name contains Unicode
+ # characters. This hack "fixes" hostname in Cygwin.
+ function hostname --description "Show or set the system's host name"
+ echo $USERDOMAIN
+ end
+end