mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-10 22:00:09 +02:00
104 lines
3.1 KiB
Plaintext
104 lines
3.1 KiB
Plaintext
From b5d5c882b27a3304a17b651a8568bb1a52307108 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
|
Date: Wed, 9 Nov 2016 22:49:48 +0100
|
|
Subject: Haiku /bin/open support
|
|
|
|
|
|
diff --git a/share/functions/open.fish b/share/functions/open.fish
|
|
index e878435..3500849 100644
|
|
--- a/share/functions/open.fish
|
|
+++ b/share/functions/open.fish
|
|
@@ -21,6 +21,10 @@ if not command -sq open
|
|
for i in $argv
|
|
xdg-open $i
|
|
end
|
|
+ else if type -q -f /bin/open
|
|
+ for i in $argv
|
|
+ /bin/open $i
|
|
+ end
|
|
else
|
|
echo (_ 'No open utility found. Try installing "xdg-open" or "xdg-utils".')
|
|
end
|
|
--
|
|
2.14.2
|
|
|
|
|
|
From dd9a8e92c8bdd66288553148c43654697c357969 Mon Sep 17 00:00:00 2001
|
|
From: Kurtis Rader <krader@skepticism.us>
|
|
Date: Sun, 4 Jun 2017 21:01:26 -0700
|
|
Subject: work around Haiku stdio bug
|
|
|
|
The Haiku stdio library has a bug. If we set stdout to unbuffered and it
|
|
is attached to a tty it discards wide output. Given how we interact with
|
|
the tty it should be safe to replace the problematic `fputwc()` calls
|
|
with simple `write()` calls. This does depend on the rest of the fish
|
|
code that writes to the tty to ultimately call write() which is true at
|
|
this time and should remain true in the future.
|
|
|
|
Fixes #4100
|
|
|
|
diff --git a/src/path.cpp b/src/path.cpp
|
|
index 1888228..e76ed27 100644
|
|
--- a/src/path.cpp
|
|
+++ b/src/path.cpp
|
|
@@ -4,7 +4,6 @@
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
#include <errno.h>
|
|
-#include <stdio.h>
|
|
#include <string.h>
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
@@ -240,7 +239,7 @@ static void maybe_issue_path_warning(const wcstring &which_dir, const wcstring &
|
|
debug(0, _(L"The error was '%s'."), strerror(saved_errno));
|
|
debug(0, _(L"Please set $%ls to a directory where you have write access."), env_var);
|
|
}
|
|
- fputwc(L'\n', stderr);
|
|
+ write(STDERR_FILENO, "\n", 1);
|
|
}
|
|
|
|
static void path_create(wcstring &path, const wcstring &xdg_var, const wcstring &which_dir,
|
|
diff --git a/src/reader.cpp b/src/reader.cpp
|
|
index 96d6d29..df4262e 100644
|
|
--- a/src/reader.cpp
|
|
+++ b/src/reader.cpp
|
|
@@ -693,14 +693,14 @@ void reader_write_title(const wcstring &cmd, bool reset_cursor_position) {
|
|
for (size_t i = 0; i < lst.size(); i++) {
|
|
fputws(lst.at(i).c_str(), stdout);
|
|
}
|
|
- fputwc(L'\a', stdout);
|
|
+ write(STDOUT_FILENO, "\a", 1);
|
|
}
|
|
|
|
proc_pop_interactive();
|
|
set_color(rgb_color_t::reset(), rgb_color_t::reset());
|
|
if (reset_cursor_position && !lst.empty()) {
|
|
// Put the cursor back at the beginning of the line (issue #2453).
|
|
- fputwc(L'\r', stdout);
|
|
+ write(STDOUT_FILENO, "\r", 1);
|
|
}
|
|
}
|
|
|
|
@@ -1284,7 +1284,7 @@ static void reader_flash() {
|
|
}
|
|
|
|
reader_repaint();
|
|
- fputwc(L'\a', stdout);
|
|
+ write(STDOUT_FILENO, "\a", 1);
|
|
|
|
pollint.tv_sec = 0;
|
|
pollint.tv_nsec = 100 * 1000000;
|
|
@@ -3216,7 +3216,7 @@ const wchar_t *reader_readline(int nchars) {
|
|
reader_repaint_if_needed();
|
|
}
|
|
|
|
- fputwc(L'\n', stdout);
|
|
+ write(STDOUT_FILENO, "\n", 1);
|
|
|
|
// Ensure we have no pager contents when we exit.
|
|
if (!data->pager.empty()) {
|
|
--
|
|
2.14.2
|
|
|
|
|