Index: src/main/java/jline/ConsoleReader.java =================================================================== RCS file: /cvsroot/jline/jline/src/main/java/jline/ConsoleReader.java,v retrieving revision 1.21 diff -u -r1.21 ConsoleReader.java --- src/main/java/jline/ConsoleReader.java 15 May 2008 18:58:09 -0000 1.21 +++ src/main/java/jline/ConsoleReader.java 10 May 2009 06:46:49 -0000 @@ -210,9 +210,10 @@ this.out = out; if (bindings == null) { try { - String bindingFile = System.getProperty("jline.keybindings", - new File(System.getProperty("user.home", - ".jlinebindings.properties")).getAbsolutePath()); + String defaultBindingFile = + new File(System.getProperty("user.home"), + ".jlinebindings.properties").getAbsolutePath(); + String bindingFile = System.getProperty("jline.keybindings", defaultBindingFile); if (new File(bindingFile).isFile()) { bindings = new FileInputStream(new File(bindingFile)); Index: src/main/java/jline/UnixTerminal.java =================================================================== RCS file: /cvsroot/jline/jline/src/main/java/jline/UnixTerminal.java,v retrieving revision 1.17 diff -u -r1.17 UnixTerminal.java --- src/main/java/jline/UnixTerminal.java 27 Jan 2008 21:18:06 -0000 1.17 +++ src/main/java/jline/UnixTerminal.java 10 May 2009 06:46:49 -0000 @@ -36,7 +36,6 @@ public static final short DEL_THIRD = 51; public static final short DEL_SECOND = 126; - private Map terminfo; private boolean echoEnabled; private String ttyConfig; private boolean backspaceDeleteSwitched = false; @@ -44,7 +43,7 @@ System.getProperty("jline.sttyCommand", "stty"); - String encoding = System.getProperty("input.encoding", "UTF-8"); + String encoding = System.getProperty("jline.UnixTerminal.input.encoding", "UTF-8"); ReplayPrefixOneCharInputStream replayStream = new ReplayPrefixOneCharInputStream(encoding); InputStreamReader replayReader; @@ -58,14 +57,18 @@ protected void checkBackspace(){ String[] ttyConfigSplit = ttyConfig.split(":|="); + String eof; - if (ttyConfigSplit.length < 7) - return; - - if (ttyConfigSplit[6] == null) + if ("gfmt1".equals(ttyConfigSplit[0]) && ttyConfigSplit.length > 20) { + // BSD style -g + eof = ttyConfigSplit[20]; + } else if (ttyConfigSplit.length > 6 && ttyConfigSplit[6] != null) { + eof = ttyConfigSplit[6]; + } else { return; + } - backspaceDeleteSwitched = ttyConfigSplit[6].equals("7f"); + backspaceDeleteSwitched = eof.equals("7f"); } /**