Exemple #1
0
        /// <summary>
        /// Strips all of the XTERM command sequences from a string and returns the cleaned string.
        /// </summary>
        public static string Strip(StringPtr Str)
        {
            if (Str == null)
            {
                return(null);
            }
            var Commands = Terminal.Compile_Command_Blocks(Str);

            StringBuilder sb = new StringBuilder();

            foreach (var Block in Commands)
            {
                sb.Append(Block.Text);
            }

            return(sb.ToString());
        }
Exemple #2
0
 internal static string Set_BG_Custom(int R, int G, int B, StringPtr Str)
 {
     int[] sub = new int[] { 2, R, G, B };
     return(string.Concat(xCmd((int)SGR_CODE.SET_COLOR_CUSTOM_BG, sub), Str.ToString(), sRESET_BG));
 }
Exemple #3
0
 /// <summary>
 /// Sets the foreground color for the given text
 /// </summary>
 /// <returns>ANSI Color encoded string</returns>
 public static string CustomFG(byte R, byte G, byte B, StringPtr Str) => Set_FG_Custom(R, G, B, Str);