Skip to content

Added option for showing current process name in tab title. - #147

Open
Bitsulia Dmitry (gaudima) wants to merge 12 commits into
JetBrains:masterfrom
gaudima:process-name-in-tab-title
Open

Added option for showing current process name in tab title.#147
Bitsulia Dmitry (gaudima) wants to merge 12 commits into
JetBrains:masterfrom
gaudima:process-name-in-tab-title

Conversation

@gaudima

Copy link
Copy Markdown

Currently works only on linux and windows. Not sure about MacOS and FreeBSD, because procfs seems to be deprecated there.

Comment thread pty/src/com/jediterm/pty/PtyMain.java Outdated
}
}

public static class PtyTabChangeListener implements TabChangeListener {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class should be definitely put out of the PtyMain to be used from other entry points, like JediTermMain or JBTerminalWidget in IntelliJ


public class LinuxProcessMonitor extends ProcessMonitor {
private class ProcfsStat {
public int pid = -1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be package private

@trofimander Dimitri Trofim (trofimander) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things to be done:

  • if a user double clicks on tab title and changes the name, this name should be preserved
  • macOs implementation
  • please measure the performance impact when the new option enabled vs when it is disabled

synchronized (lock) {
if(instance == null) {
if (UIUtil.isLinux) {
instance = new LinuxProcessMonitor();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOs implementation is pending

} else if (UIUtil.isWindows) {
instance = new WindowsProcessMonitor();
} else {
instance = new ProcessMonitor();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default implementation is very CPU consuming, while it doesn't do anything usefull.

}

@Override
public boolean jobNameAsTabName() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call this settings showProcessNameInTabTitle

openSession(terminalWidget);
return true;
});
widget.setTabChangeListener(new PtyTabChangeListener());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the same functionality to JediTermMain standalone version

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

Successfully merging this pull request may close these issues.

2 participants