Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with Terminus, opens a new tab #229

Open
hwonsok opened this issue Jul 16, 2020 · 11 comments
Open

Building with Terminus, opens a new tab #229

hwonsok opened this issue Jul 16, 2020 · 11 comments

Comments

@hwonsok
Copy link

hwonsok commented Jul 16, 2020

I am currently using Terminus with Origami to pop up the console on the right pane.

Every time a I build using Terminus, a new tab is created instead of the current open one being updated.

As I am trying to replicate sublime text's console as much as possible, I would like to know if there is a way to disable a new tab to be opened and updating the current one instead.

@randy3k
Copy link
Owner

randy3k commented Jul 16, 2020

How about using the panel?

@hwonsok
Copy link
Author

hwonsok commented Jul 16, 2020

I am sorry but I am very new to sublime text so I am not really sure what panel you are referring to.

@randy3k
Copy link
Owner

randy3k commented Jul 16, 2020

In that case, you may want to consider looking at this section https://github.com/randy3k/Terminus#terminus-build-system

@hwonsok
Copy link
Author

hwonsok commented Jul 16, 2020

I have created a new .sublime-build file that has the following configuration:

{
    "target": "terminus_open",

    "auto_close": false,
    
    "post_window_hooks": [
        ["carry_file_to_pane", {"direction": "right"}]
    ],

    "shell_cmd": "python -u \"$file\"",
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",

    "env": {"PYTHONIOENCODING": "utf-8"},

    "variants":
    [
        {
            "name": "Syntax Check",
            "shell_cmd": "python -m py_compile \"${file}\"",
        }
    ]
}

Still not entirely sure if this is what you are referring to.

@randy3k
Copy link
Owner

randy3k commented Jul 16, 2020

You could use the target

            "target": "terminus_exec",
            "cancel": "terminus_cancel_build",

instead. The cancel command is also recommended

@hwonsok
Copy link
Author

hwonsok commented Jul 16, 2020

By using "target": "terminus_exec", it does indeed make Terminus operate just as the console, but I am no longer able to move it to the right pane as it is no longer a tab.

I am uncertain if this is a situation I have to choose in between:

  1. Terminus behaving as the console but not able to move it to the right pane.
  2. Being able to move Terminus to the right pane, but a new tab being created every time a file is built.

I wonder if there is a third scenario where it is possible to have the Terminus behave as the console but also move it to the right pane. Even if it is as simple as having Terminus open a new tab and close the previous one (if one is currently open).

@randy3k
Copy link
Owner

randy3k commented Jul 16, 2020

Seems fair, I have just pushed a new commit afb5a7c which allows reusing the tagged view.
Something along this line.

{
    "target": "terminus_open",

	"tag": "python build",

    "auto_close": false,
    
    "post_window_hooks": [
        ["carry_file_to_pane", {"direction": "right"}]
    ],

    "shell_cmd": "python -u \"$file\"",
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",

    "env": {"PYTHONIOENCODING": "utf-8"},

    "variants":
    [
        {
            "name": "Syntax Check",
            "shell_cmd": "python -m py_compile \"${file}\"",
        }
    ]
}

@hwonsok
Copy link
Author

hwonsok commented Jul 17, 2020

I'll wait for the next update.
Thank you very much!

@g-regor
Copy link

g-regor commented Oct 24, 2020

Is this supposed to work now?

With

    "post_window_hooks": [
        ["carry_file_to_pane", {"direction": "right"}]
    ],

it keeps splitting the right most pane and adding the tab there.

@hovsater
Copy link

@randy3k has a regression been introduced since afb5a7c? I've added a tag to my build system but terminus_open still opens a new tab for each invocation.

@hovsater
Copy link

Ping @randy3k.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants