bend-kit-tty Releases (2): 0.1.0.1 0xbb2c503928ea15731255ec8c06e5564b indexed https://jend.leeeet.dev/files.txt?path=bend-kit-tty@0.1.0.1 0.1.0.0 0xd60fd658d4bdabf892f8041a7a731848 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-tty@0.1.0.0 Definitions (1012, 1 to 100 shown): Text.style (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/text.bend&name=style) # Wrap text in one numeric SGR code and a reset when enabled; otherwise return it unchanged. def style(enabled: Bool, code: U32, text: String) -> String: Text.vs16 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/text.bend&name=vs16) def vs16(s: String) -> Bool: Text.cluster (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/text.bend&name=cluster) # A grapheme cluster takes its first code point's columns (W.w); VS16 makes a narrow base an emoji, 2 wide. def cluster(g: String) -> U32: Text.width.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/text.bend&name=width.go) def width.go(gs: List<&2, String>, +acc: U32) -> U32: Text.width (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/text.bend&name=width) # Display columns: East Asian Wide and Fullwidth clusters are 2, marks and controls 0, Ambiguous 1. # Escape sequences are not stripped: style()'s output is wider than what the terminal shows. def width(text: String) -> U32: Text.pad_right (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/text.bend&name=pad_right) # Append spaces until text occupies at least cols display columns. def pad_right(+text: String, +cols: U32) -> String: Tty.stdout_tty (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=stdout_tty) # Standard output is a terminal. def stdout_tty() -> IO(Bool): Tty.size (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=size) # Terminal columns and rows; None when stdout is not a terminal or its size is unavailable. def size() -> IO(Maybe<&1, U32 & U32>): Tty.color_enabled (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=color_enabled) # Automatic styling is enabled only for a terminal without NO_COLOR. def color_enabled() -> IO(Bool): Tty.style (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=style) # Apply one numeric ANSI SGR code and reset it, or leave the text unchanged. def style(enabled: Bool, code: U32, text: String) -> String: Tty.auto_style (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=auto_style) def auto_style(code: U32, text: String) -> IO(String): Tty.width (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=width) # Display columns for Unicode text. Control characters are not terminal cursor movements. def width(text: String) -> U32: Tty.pad_right (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/tty.bend&name=pad_right) # Append spaces until text occupies at least cols display columns. def pad_right(text: String, cols: U32) -> String: Width.w.n0 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n0) def w.n0(lt: Bool, +c: U32) -> U32: Width.w.n1 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n1) def w.n1(lt: Bool, +c: U32) -> U32: Width.w.n2 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n2) def w.n2(lt: Bool, +c: U32) -> U32: Width.w.n3 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n3) def w.n3(lt: Bool, +c: U32) -> U32: Width.w.n4 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n4) def w.n4(lt: Bool, +c: U32) -> U32: Width.w.n5 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n5) def w.n5(lt: Bool, +c: U32) -> U32: Width.w.n6 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n6) def w.n6(lt: Bool, +c: U32) -> U32: Width.w.n7 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n7) def w.n7(lt: Bool, +c: U32) -> U32: Width.w.n8 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n8) def w.n8(lt: Bool, +c: U32) -> U32: Width.w.n9 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n9) def w.n9(lt: Bool, +c: U32) -> U32: Width.w.n10 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n10) def w.n10(lt: Bool, +c: U32) -> U32: Width.w.n11 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n11) def w.n11(lt: Bool, +c: U32) -> U32: Width.w.n12 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n12) def w.n12(lt: Bool, +c: U32) -> U32: Width.w.n13 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n13) def w.n13(lt: Bool, +c: U32) -> U32: Width.w.n14 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n14) def w.n14(lt: Bool, +c: U32) -> U32: Width.w.n15 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n15) def w.n15(lt: Bool, +c: U32) -> U32: Width.w.n16 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n16) def w.n16(lt: Bool, +c: U32) -> U32: Width.w.n17 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n17) def w.n17(lt: Bool, +c: U32) -> U32: Width.w.n18 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n18) def w.n18(lt: Bool, +c: U32) -> U32: Width.w.n19 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n19) def w.n19(lt: Bool, +c: U32) -> U32: Width.w.n20 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n20) def w.n20(lt: Bool, +c: U32) -> U32: Width.w.n21 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n21) def w.n21(lt: Bool, +c: U32) -> U32: Width.w.n22 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n22) def w.n22(lt: Bool, +c: U32) -> U32: Width.w.n23 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n23) def w.n23(lt: Bool, +c: U32) -> U32: Width.w.n24 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n24) def w.n24(lt: Bool, +c: U32) -> U32: Width.w.n25 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n25) def w.n25(lt: Bool, +c: U32) -> U32: Width.w.n26 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n26) def w.n26(lt: Bool, +c: U32) -> U32: Width.w.n27 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n27) def w.n27(lt: Bool, +c: U32) -> U32: Width.w.n28 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n28) def w.n28(lt: Bool, +c: U32) -> U32: Width.w.n29 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n29) def w.n29(lt: Bool, +c: U32) -> U32: Width.w.n30 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n30) def w.n30(lt: Bool, +c: U32) -> U32: Width.w.n31 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n31) def w.n31(lt: Bool, +c: U32) -> U32: Width.w.n32 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n32) def w.n32(lt: Bool, +c: U32) -> U32: Width.w.n33 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n33) def w.n33(lt: Bool, +c: U32) -> U32: Width.w.n34 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n34) def w.n34(lt: Bool, +c: U32) -> U32: Width.w.n35 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n35) def w.n35(lt: Bool, +c: U32) -> U32: Width.w.n36 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n36) def w.n36(lt: Bool, +c: U32) -> U32: Width.w.n37 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n37) def w.n37(lt: Bool, +c: U32) -> U32: Width.w.n38 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n38) def w.n38(lt: Bool, +c: U32) -> U32: Width.w.n39 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n39) def w.n39(lt: Bool, +c: U32) -> U32: Width.w.n40 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n40) def w.n40(lt: Bool, +c: U32) -> U32: Width.w.n41 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n41) def w.n41(lt: Bool, +c: U32) -> U32: Width.w.n42 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n42) def w.n42(lt: Bool, +c: U32) -> U32: Width.w.n43 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n43) def w.n43(lt: Bool, +c: U32) -> U32: Width.w.n44 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n44) def w.n44(lt: Bool, +c: U32) -> U32: Width.w.n45 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n45) def w.n45(lt: Bool, +c: U32) -> U32: Width.w.n46 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n46) def w.n46(lt: Bool, +c: U32) -> U32: Width.w.n47 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n47) def w.n47(lt: Bool, +c: U32) -> U32: Width.w.n48 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n48) def w.n48(lt: Bool, +c: U32) -> U32: Width.w.n49 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n49) def w.n49(lt: Bool, +c: U32) -> U32: Width.w.n50 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n50) def w.n50(lt: Bool, +c: U32) -> U32: Width.w.n51 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n51) def w.n51(lt: Bool, +c: U32) -> U32: Width.w.n52 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n52) def w.n52(lt: Bool, +c: U32) -> U32: Width.w.n53 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n53) def w.n53(lt: Bool, +c: U32) -> U32: Width.w.n54 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n54) def w.n54(lt: Bool, +c: U32) -> U32: Width.w.n55 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n55) def w.n55(lt: Bool, +c: U32) -> U32: Width.w.n56 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n56) def w.n56(lt: Bool, +c: U32) -> U32: Width.w.n57 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n57) def w.n57(lt: Bool, +c: U32) -> U32: Width.w.n58 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n58) def w.n58(lt: Bool, +c: U32) -> U32: Width.w.n59 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n59) def w.n59(lt: Bool, +c: U32) -> U32: Width.w.n60 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n60) def w.n60(lt: Bool, +c: U32) -> U32: Width.w.n61 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n61) def w.n61(lt: Bool, +c: U32) -> U32: Width.w.n62 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n62) def w.n62(lt: Bool, +c: U32) -> U32: Width.w.n63 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n63) def w.n63(lt: Bool, +c: U32) -> U32: Width.w.n64 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n64) def w.n64(lt: Bool, +c: U32) -> U32: Width.w.n65 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n65) def w.n65(lt: Bool, +c: U32) -> U32: Width.w.n66 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n66) def w.n66(lt: Bool, +c: U32) -> U32: Width.w.n67 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n67) def w.n67(lt: Bool, +c: U32) -> U32: Width.w.n68 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n68) def w.n68(lt: Bool, +c: U32) -> U32: Width.w.n69 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n69) def w.n69(lt: Bool, +c: U32) -> U32: Width.w.n70 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n70) def w.n70(lt: Bool, +c: U32) -> U32: Width.w.n71 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n71) def w.n71(lt: Bool, +c: U32) -> U32: Width.w.n72 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n72) def w.n72(lt: Bool, +c: U32) -> U32: Width.w.n73 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n73) def w.n73(lt: Bool, +c: U32) -> U32: Width.w.n74 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n74) def w.n74(lt: Bool, +c: U32) -> U32: Width.w.n75 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n75) def w.n75(lt: Bool, +c: U32) -> U32: Width.w.n76 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n76) def w.n76(lt: Bool, +c: U32) -> U32: Width.w.n77 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n77) def w.n77(lt: Bool, +c: U32) -> U32: Width.w.n78 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n78) def w.n78(lt: Bool, +c: U32) -> U32: Width.w.n79 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n79) def w.n79(lt: Bool, +c: U32) -> U32: Width.w.n80 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n80) def w.n80(lt: Bool, +c: U32) -> U32: Width.w.n81 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n81) def w.n81(lt: Bool, +c: U32) -> U32: Width.w.n82 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n82) def w.n82(lt: Bool, +c: U32) -> U32: Width.w.n83 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n83) def w.n83(lt: Bool, +c: U32) -> U32: Width.w.n84 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n84) def w.n84(lt: Bool, +c: U32) -> U32: Width.w.n85 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n85) def w.n85(lt: Bool, +c: U32) -> U32: Width.w.n86 (https://jend.leeeet.dev/definition.txt?path=bend-kit-tty@0.1.0.1/width.bend&name=w.n86) def w.n86(lt: Bool, +c: U32) -> U32: More: https://jend.leeeet.dev/packages/bend-kit-tty.txt?definitions_offset=100