randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

build c++ with Terminus #255

Open blonded04 opened 3 years ago

blonded04 commented 3 years ago

Hello, i realized i cant output build g++ messages on linux to Terminus.

I tried writing something like that, but it doesnt work at all:

{  
    "target": "terminus_exec",
    "cancel": "terminus_cancel_build",
    "cmd": "g++ -std=c++17 -Wshadow -Wall -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG \"${file}\" -o \"${file_path}/${file_base_name}\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",

    "variants":
    [
        {
            "target": "terminus_exec",
            "cancel": "terminus_cancel_build",
            "name": "Run",
            "cmd": "g++ -std=c++17 -Wshadow -Wall -O2 -Wno-unused-result \"${file}\" -o \"${file_path}/${file_base_name}\""
        }
    ]
}

If i use shell_cmd instead of cmd it works fine but uses terminal, not Terminus

Can you please help me fix it? Thank you!

randy3k commented 3 years ago

Could you elaborate a bit more? Does shell_cmd work for you?

blonded04 commented 3 years ago

Could you elaborate a bit more? Does shell_cmd work for you?

Yes, it works for me fine but opens classic sublime terminal in the bottom window, not writing g++ -std=c++17 -Wshadow -Wall -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG to the Terminus(thats what i want it to do). I have it in my .sublime-build file and i have chosen that file as my build configuration

randy3k commented 3 years ago

Oic. It is not how it works. The command terminus_exec doesn't send text to a Terminus window. There is a way to implement it by using the command terminus_keypress but it requires writing a smaller wrapper plugin to do so, it may not be immediately obvious for sublime text beginners.