All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.panayotis.jerminal.Jerminal Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.panayotis.jerminal;

import static com.panayotis.jerminal.SystemDependent.isWindows;

/**
 * @author teras
 */
public class Jerminal {

    final static String EmphOn, EmphOff;
    private static int width = -1;

    static {
        if (isWindows)
            EmphOn = EmphOff = "";
        else {
            EmphOn = "\033[0m\033[1m";
            EmphOff = "\033[0m";
        }
    }

    public static int getWidth() {
        if (width < 0)
            width = isWindows ? TermWindows.width() : TermUnix.width();
        return width;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy