feat: «Здесь» from a machine's terminal opens the file pane in the terminal's folder (asked of the agent); Аккаунт › Вид can turn «Здесь» back to the home folder. Version 0.2.1
This commit is contained in:
1 parent
57c2f1338f
commit
087eabf3b4
12 files changed
+163
-6
No files matched your search
@@ -567,9 +567,16 @@
|
||||
if (here) item(content, '<span class="ico">+</span><span><b>Здесь</b><small>' + esc(here.name) + ' · ' + esc(here.user + '@' + here.host) + '</small></span>',
|
||||
() => {
|
||||
closeMenu();
|
||||
// A terminal from a machine's file pane starts in its folder.
|
||||
const dir = kind === 'term' && activePane.kind === 'files' ? activePane.cwd : '';
|
||||
openPane(kind, here, dir ? {dir} : null);
|
||||
// A terminal from a machine's file pane starts in its folder, a
|
||||
// file pane from a machine's terminal in the terminal's (asked of
|
||||
// the machine; home if it cannot tell) - unless turned off.
|
||||
const on = !(window.Prefs && Prefs.get().openHere === 'off');
|
||||
let opts = null;
|
||||
if (on && kind === 'term' && activePane.kind === 'files') opts = {dir: activePane.cwd};
|
||||
else if (on && kind === 'files' && activePane.kind === 'term' && activePane.sid) {
|
||||
opts = {dir: new MachineSource(here).op('termcwd', {session: activePane.sid}).then(r => r.ok && r.data ? r.data.path : '')};
|
||||
}
|
||||
openPane(kind, here, opts);
|
||||
});
|
||||
const box = document.createElement('div');
|
||||
box.innerHTML = '<div class="muted" style="padding:8px 10px;font-size:13px">загрузка…</div>';
|
||||
|
||||
Reference in new issue
Block a user