Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
18495cd
Fixed: Clear LineWrap flag when clearing lines using blockSet
MatanZ Sep 3, 2022
439b0b6
Fixed: Revert using `Canvas.drawText()` instead of `Canvas.drawTextRu…
agnostic-apollo Mar 30, 2026
bdc3d72
Fixed: Explicitly cast cursor dimensions to float to prevent loses
agnostic-apollo Mar 30, 2026
4748e23
Changed: Use `int` instead of `short` for space used for proper indexing
agnostic-apollo Mar 31, 2026
7461709
Fixed|Changed: Explicitly pass `Base64.DEFAULT` while base64 decoding…
agnostic-apollo Apr 9, 2026
948ffa4
Added|Changed|Fixed: Standardize function/variable names and add docs…
agnostic-apollo Apr 8, 2026
a7f2872
Add sixel support:
MatanZ Apr 8, 2026
69ce502
Added: Add terminal support for Bitmaps, Sixel (`DCS q`) and iTerm Im…
agnostic-apollo Apr 9, 2026
3ec521f
Changed: Increase Sixel and iTerm Image limits
agnostic-apollo Apr 13, 2026
253eee9
Changed: Increase OCS 52 buffer limit to `100KB` for text to set to c…
agnostic-apollo Apr 14, 2026
2151d08
Fixed: Allow sixel DCS command start `P3` arg to not end with a semic…
agnostic-apollo May 5, 2026
5f64369
Merge upstream master into kitty-graphics work branch
kotamat Aug 5, 2026
9add03d
Fixed: Do not create a terminal bitmap for an image whose bitmap boun…
kotamat Aug 5, 2026
52c2c8d
Fixed: Draw the pending text run before a terminal bitmap so that tex…
kotamat Aug 5, 2026
1331824
Fixed: Leave the cursor after an image on the last row it covers if t…
kotamat Aug 5, 2026
27eea1b
Added: Add terminal support for kitty graphics protocol images (`APC …
kotamat Aug 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.termux.terminal;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class AndroidUtils {

/**
* Get system properties as {@link Properties} from `/system/bin/getprop` command output
* that reads the `/system/build.prop` file.
*
* Sourced from https://github.com/termux/termux-app/blob/30ebb2dee381d292ade0f2868cfde0f9f20b89fe/termux-shared/src/main/java/com/termux/shared/android/AndroidUtils.java#L170.
*/
public static Properties getSystemProperties(String logTag) {
Properties systemProperties = new Properties();

// getprop commands returns values in the format `[key]: [value]`
// Regex matches string starting with a literal `[`,
// followed by one or more characters that do not match a closing square bracket as the key,
// followed by a literal `]: [`,
// followed by one or more characters as the value,
// followed by string ending with literal `]`
// multiline values will be ignored
Pattern propertiesPattern = Pattern.compile("^\\[([^]]+)]: \\[(.+)]$");

try {
Process process = new ProcessBuilder()
.command("/system/bin/getprop")
.redirectErrorStream(true)
.start();

InputStream inputStream = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line, key, value;

while ((line = bufferedReader.readLine()) != null) {
Matcher matcher = propertiesPattern.matcher(line);
if (matcher.matches()) {
key = matcher.group(1);
value = matcher.group(2);
if (key != null && value != null && !key.isEmpty() && !value.isEmpty())
systemProperties.put(key, value);
}
}

bufferedReader.close();
process.destroy();

} catch (IOException e) {
Logger.logStackTraceWithMessage(null, logTag, "Failed to get run \"/system/bin/getprop\" to get system properties.", e);
}

//for (String key : systemProperties.stringPropertyNames()) {
// Logger.logVerbose(null, logTag, key + ": " + systemProperties.get(key));
//}

return systemProperties;
}

}
Loading