jdTextEdit - A advanced Text Editor

I found the error. jdTextEdit ties to create his folder on a completely other place when it launches from the Menu. This directory doesn’t exists yet and jdTextEdit is unable to create sub directories in the current versions. This will be fixed in the future. In the mean time run this in the Terminak to fix the problem:

mkdir -p ~/.local/share

But it doesn’t fix the problem, that jdTextEdit uses a completely other directory when it is launched from the Terminal. It currently uses the following code to find the directory:

def getDataPath(env):
    if env.args["dataDir"]:
        return env.args["dataDir"]
    elif os.getenv("JDTEXTEDIT_DATA_PATH"):
        return os.getenv("JDTEXTEDIT_DATA_PATH")
    elif "dataDirectory" in env.distributionSettings:
        return env.distributionSettings["dataDirectory"].replace("~",str(Path.home()))
    elif os.getenv("SNAP_USER_DATA"):
        return os.path.join(os.getenv("SNAP_USER_DATA"),"jdTextEdit")
    elif platform.system() == 'Windows':
        return os.path.join(os.getenv("appdata"),"jdTextEdit")
    elif platform.system() == 'Darwin':
        return os.path.join(str(Path.home()),"Library","Application Support","jdTextEdit")
    else:
        if os.getenv("XDG_DATA_HOME"):
            return os.path.join(os.getenv("XDG_DATA_HOME"),"jdTextEdit")
        else:
            return os.path.join(str(Path.home()),".local","share","jdTextEdit")

I think it uses XDG_DATA_HOME when it is launched from the Terminal. Have anyone a suggestion which folder I should use on Haiku?

Besides of that, I think it’s a big problem that Haiku launches programs with other environment vars if you start a program from Terminal or from Menu. That may affect more programs and is a thing that needs to be fixed.

1 Like