mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-31 18:52:12 +00:00
input configuration to pass input as stdin on startup
This adds a new configuration `input` that allows passing either raw text or file contents as stdin when starting the terminal. The input is sent byte-for-byte to the terminal, so control characters such as `\n` will be interpreted by the shell and can be used to run programs in the context of the loaded shell. Example: `ghostty --input="hello, world\n"` will start the your default shell, run `echo hello, world`, and then show the prompt.
This commit is contained in:
@@ -3,7 +3,7 @@ const std = @import("std");
|
||||
/// Parse a string literal into a byte array. The string can contain
|
||||
/// any valid Zig string literal escape sequences.
|
||||
///
|
||||
/// The output buffer never needs sto be larger than the input buffer.
|
||||
/// The output buffer never needs to be larger than the input buffer.
|
||||
/// The buffers may alias.
|
||||
pub fn parse(out: []u8, bytes: []const u8) ![]u8 {
|
||||
var dst_i: usize = 0;
|
||||
|
||||
Reference in New Issue
Block a user