Mitchell Hashimoto
67dce5ce0e
update zig-objc
2023-11-17 21:50:34 -08:00
Krzysztof Wolicki
44a48f62f1
change unmodified var
s to const
s in anticipation of zig changes
2023-11-17 15:46:46 +01:00
Krzysztof Wolicki
0822e99a56
os/xdg: Add LOCALAPPDATA
as a fallback for XDG_CONFIG_HOME
on Windows
2023-11-13 02:05:29 +01:00
Mitchell Hashimoto
3dc2bbc9b0
os: add internal_os.pipe for cross-platfor pipe
2023-11-05 15:54:50 -08:00
Mitchell Hashimoto
fbd2c34487
os: more comments
2023-11-05 15:48:43 -08:00
Mitchell Hashimoto
b39d1d6095
shuffle some code
2023-11-05 15:46:31 -08:00
Mitchell Hashimoto
ea5ff77e29
os: macos lang check should include lang null
2023-11-05 15:46:05 -08:00
Mitchell Hashimoto
74b840df8e
rename Pty.zig to pty.zig
2023-11-05 23:41:45 +00:00
Mitchell Hashimoto
8f35d5251e
os: rename env to be posix-like, do not allocate on posix
2023-11-05 15:39:25 -08:00
Mitchell Hashimoto
7594bbd621
shuffle some source around
2023-11-05 15:27:46 -08:00
kcbanner
9a5322eaf4
- Update libxev dependency
...
- Fixup macos compile error
2023-11-05 23:15:52 +00:00
kcbanner
232df8de8f
windows: add support for the glfw backend on Windows
...
Changes:
- Add WindowsPty, which uses the ConPTY API to create a pseudo console
- Pty now selects between PosixPty and WindowsPty
- Windows support in Command, including the ability to launch a process with a pseudo console
- Enable Command tests on windows
- Add some environment variable abstractions to handle the missing libc APIs on Windows
- Windows version of ReadThread
2023-11-05 23:15:49 +00:00
Mitchell Hashimoto
7a1c54ad05
update zig
2023-10-24 15:02:26 -07:00
Mitchell Hashimoto
cbdf52864a
Merge pull request #704 from der-teufel-programming/windows-test
...
Get `zig build test` working on Windows
2023-10-23 08:52:43 -07:00
Mitchell Hashimoto
4a199448a2
os: update todo about subsystem for windows
2023-10-23 08:48:53 -07:00
Mitchell Hashimoto
3226cbf61b
os: remove some duplication in the env var check for xdg config
2023-10-23 08:47:16 -07:00
Brandon Ferguson
17957b8fb3
If the locale isn't supported and falls back to the POSIX/C locale, use en_US.UTF8
2023-10-21 10:33:26 -07:00
Krzysztof Wolicki
f4a2273ad9
os/xdg: Avoid allocations on non-Windows systems.
...
os/desktop: Add TODO
2023-10-19 17:22:11 +02:00
Krzysztof Wolicki
3936b471a8
Disable iconv on Windows by default (enabled via cli flag).
...
Skip various tests not implemented on windows.
2023-10-19 09:39:20 +02:00
Mitchell Hashimoto
2b28106837
update zig
2023-10-02 08:18:35 -07:00
Mitchell Hashimoto
3c0700c6b0
os: launchFromDesktop works even if the artifact is a lib
...
Fixes #598
2023-09-30 19:09:52 -07:00
Mitchell Hashimoto
d03083c7f5
apprt/gtk: default working-directory to home if launched from desktop
...
Fixes #573
2023-09-29 15:52:45 -07:00
Mitchell Hashimoto
d878d16779
os: unset lang completely setlocale fails
2023-09-29 13:11:07 -07:00
Mitchell Hashimoto
38a7c2270b
os: we need to copy the old lang pointer before we unsetenv
2023-09-29 12:56:43 -07:00
Mitchell Hashimoto
0026c40062
Simplify setlocale logic to rely on libc to fail if invalid
...
Instead of checking if a locale is valid, let's change this logic:
1. We first try setlocale to inherit from env vars, system default.
2. Next, we fall back to unsetting LANG if it was set manually,
allowing us to fall back to system defaults.
3. We fall back to en_US.UTF-8.
2023-09-26 17:35:19 -07:00
Mitchell Hashimoto
ea4bc95f43
os: appendEnv
2023-09-20 13:02:06 -07:00
Will Pragnell
8f2ab46e1e
windows: use cross platform consts where available
2023-09-15 16:01:33 -07:00
Will Pragnell
57894786d4
windows: implement tmpDir
2023-09-14 20:48:09 -07:00
Jonathan Marler
a2e881ff4e
windows: initial support for zig build test
...
Makes progress getting "zig build test" to work on windows. Mostly
fixed issues around build configuration and added some branches throughout
the Zig code to return/throw errors for unimplemented parts.
I also added an initial implementation for getting the home dir.
2023-09-14 03:15:40 -06:00
Mitchell Hashimoto
bd7cc4b71d
core: App looks up resources dir on startup
2023-08-08 09:21:52 -07:00
Mitchell Hashimoto
4e9dcf6b62
os: add resourcesDir function to find app resource dir
2023-08-08 09:17:14 -07:00
Thorsten Ball
5472d03832
locale: remove default value for local dev env
...
I commented this out to test something locally and it compiles & runs
fine on macOS with Xcode. Looks like it's not needed anymore.
2023-07-19 06:46:01 +02:00
Thorsten Ball
4b48d42a07
locale: set LANG to the fallback value if we have invalid locale
...
See #201 for more information.
Problem is that while we fall back to a default value to pass to
`setlocale`, we don't set a `LANG` and instead reset it to `""`.
What this does here is it changes the resetting to `""` and instead sets
it to the default value.
2023-07-19 06:44:35 +02:00
Mitchell Hashimoto
4176c6bdbf
reset LANG env var if we set it and it is invalid
...
This was breaking downstream programs, see #201
2023-07-18 10:49:43 -07:00
Mitchell Hashimoto
0849aa8f20
validate locale prior to setting, fallback to en_US.UTF-8
...
Fixes #201
I don't fully understand locales, but it appears that the locale
returned from NSLocale can be "valid" in general but invalid according
to libc's locale API. If you attempt to `setlocale` with this bad
locale, it defaults everything to "C", which ends up breaking a lot of
things.
This commit validates the locale, and if it is invalid, we default to
"en_US.UTF-8" so things tend to work. This behavior can be overridden
using standard environment variables (LANG, LC_ALL, etc.).
This also doesn't touch env vars so further subprocesses from the shell
see original locale env vars.
2023-07-11 11:50:12 -07:00
Mitchell Hashimoto
bf25bf0a6a
move a bunch of files to src/os
2023-07-10 16:48:22 -07:00
Mitchell Hashimoto
9a0d131b5b
move TempDir to src/os and use the real tmpDir
2023-07-09 12:14:05 -07:00
Mitchell Hashimoto
26e17de777
add os.tmpDir to get the recommended temp dir base path
2023-07-09 11:58:04 -07:00
Mitchell Hashimoto
314f9287b1
Update Zig ( #164 )
...
* update zig
* pkg/fontconfig: clean up @as
* pkg/freetype,harfbuzz: clean up @as
* pkg/imgui: clean up @as
* pkg/macos: clean up @as
* pkg/pixman,utf8proc: clean up @as
* clean up @as
* lots more @as cleanup
* undo flatpak changes
* clean up @as
2023-06-30 12:15:31 -07:00
Mitchell Hashimoto
8a83a1e4a9
fix min usage in src/os
2023-06-25 11:17:51 -07:00
Mitchell Hashimoto
56f8e39e5b
Update zig, mach, fmt
2023-06-25 11:08:20 -07:00
Mitchell Hashimoto
77dcc10f80
linux: fit gtk/flatpak builds
2023-05-27 10:01:20 -07:00
Mitchell Hashimoto
83a1d783b1
termio: implement kill command for flatpak
2023-02-27 11:44:18 -08:00
Mitchell Hashimoto
630374060d
passwd uses new FlatpakHostCommand
2023-02-27 11:02:59 -08:00
Mitchell Hashimoto
f64d871847
os: FlatpakHostCommand uses thread with its own event loop
2023-02-27 10:18:56 -08:00
Mitchell Hashimoto
f89d202b0d
flatpak.HostCommand wip
2023-02-26 10:28:54 -08:00
Mitchell Hashimoto
0a041957f1
os: add flatpak detection
2023-02-25 21:20:48 -08:00
Mitchell Hashimoto
ec956debb7
Command/Pty work better with Flatpak but not 100% yet
2023-02-25 21:19:57 -08:00
Mitchell Hashimoto
230157d60b
remove unused import
2022-12-31 09:07:14 -08:00
Mitchell Hashimoto
e8a1fe4d87
move wasm target struct around to avoid analyzing wasm file on non-wasm
2022-12-31 09:04:11 -08:00