diff --git a/src/main/java/snowflake/App.java b/src/main/java/snowflake/App.java index 24d48615..d52cf20e 100644 --- a/src/main/java/snowflake/App.java +++ b/src/main/java/snowflake/App.java @@ -72,6 +72,8 @@ public static void main(String[] args) throws UnsupportedLookAndFeelException { UIManager.setLookAndFeel(nimbusLookAndFeel); UIManager.put("control", Color.WHITE); + UIManager.put("nimbusSelectionBackground", new Color(3, 155, 229)); + //UIManager.put("nimbusBase", new Color(200, 200, 200)); // UIManager.put("text", new Color(208, 208, 208)); diff --git a/src/main/java/snowflake/common/ssh/files/SshFileSystem.java b/src/main/java/snowflake/common/ssh/files/SshFileSystem.java index 76b8fd56..e50d99ed 100644 --- a/src/main/java/snowflake/common/ssh/files/SshFileSystem.java +++ b/src/main/java/snowflake/common/ssh/files/SshFileSystem.java @@ -3,6 +3,7 @@ import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.SftpATTRS; import com.jcraft.jsch.SftpException; +import com.jcraft.jsch.SftpStatVFS; import snowflake.common.*; import snowflake.common.FileSystem; import snowflake.common.ssh.AbstractUserInteraction; @@ -12,10 +13,7 @@ import java.io.*; import java.nio.file.AccessDeniedException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Vector; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; public class SshFileSystem implements FileSystem { @@ -149,6 +147,7 @@ private List listFiles(String path) throws Exception { continue; } SftpATTRS attrs = ent.getAttrs(); + if (attrs.isLink()) { childs.add(resolveSymlink(ent.getFilename(), PathUtils.combineUnix(path, @@ -509,4 +508,10 @@ public String getSeparator() { public String getSeparator() { return "/"; } + + public void statFs() throws Exception { + ensureConnected(); + SftpStatVFS statVFS = this.sftp.statVFS("/"); + System.out.println(statVFS.getSize() + " " + statVFS.getUsed()); + } } diff --git a/src/main/java/snowflake/components/files/browser/ssh/SshFileBrowserView.java b/src/main/java/snowflake/components/files/browser/ssh/SshFileBrowserView.java index 5b985adf..c6f5f201 100644 --- a/src/main/java/snowflake/components/files/browser/ssh/SshFileBrowserView.java +++ b/src/main/java/snowflake/components/files/browser/ssh/SshFileBrowserView.java @@ -45,6 +45,9 @@ public SshFileBrowserView(FileBrowser fileBrowser, this.addressPopup = menuHandler.createAddressPopup(); if (initialPath == null) { this.path = holder.getInfo().getRemoteFolder(); + if (this.path != null && this.path.trim().length() < 1) { + this.path = null; + } System.out.println("Path: " + path); } else { this.path = initialPath; @@ -146,6 +149,7 @@ public void render(String path, boolean useCache) { try { if (path == null) { this.path = holder.getSshFileSystem().getHome(); + //holder.getSshFileSystem().statFs(); } renderDirectory(this.path, useCache); break; diff --git a/src/main/java/snowflake/components/terminal/TerminalComponent.java b/src/main/java/snowflake/components/terminal/TerminalComponent.java index 7385a443..05a863a2 100644 --- a/src/main/java/snowflake/components/terminal/TerminalComponent.java +++ b/src/main/java/snowflake/components/terminal/TerminalComponent.java @@ -15,6 +15,8 @@ import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; public class TerminalComponent extends JPanel implements ConnectedResource { private JRootPane rootPane; @@ -63,6 +65,13 @@ public TerminalComponent(SessionInfo info, String name, String command) { term.setTtyConnector(tty); term.start(); contentPane.add(term); + + addComponentListener(new ComponentAdapter() { + @Override + public void componentShown(ComponentEvent e) { + requestFocusInWindow(); + } + }); } @Override diff --git a/src/main/java/snowflake/components/terminal/TerminalHolder.java b/src/main/java/snowflake/components/terminal/TerminalHolder.java index fa328723..a2f00660 100644 --- a/src/main/java/snowflake/components/terminal/TerminalHolder.java +++ b/src/main/java/snowflake/components/terminal/TerminalHolder.java @@ -7,6 +7,8 @@ import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -107,6 +109,13 @@ public TerminalHolder(SessionInfo info) { snippetPopupMenu.add(snippetPanel); createNewTerminal(); + + addComponentListener(new ComponentAdapter() { + @Override + public void componentShown(ComponentEvent e) { + requestFocusInWindow(); + } + }); } private void showSnippets() {