Skip to content

Commit 3e0266a

Browse files
committed
Make readLine less noisy.
1 parent 6ab370c commit 3e0266a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

Sources/CommandLineKit/AnsiCodes.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public struct AnsiCodes {
4545
/// The following line is a hack. It is the only reliable way I could get "Terminal.app" on
4646
/// macOS to return to the beginning of the line
4747
public static let beginningOfLine: String = cursorBackward(3000) + cursorBackward(999)
48+
public static let endOfLine: String = cursorForward(3000) + cursorForward(999)
4849

4950
/// Clear screen
5051
public static let clearScreen: String = escapeCode("2J")

Sources/CommandLineKit/LineReader.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,16 +610,12 @@ public class LineReader {
610610
private func moveLeft(editState: EditState) throws {
611611
if editState.moveLeft() {
612612
try self.updateCursorPos(editState: editState)
613-
} else {
614-
self.ringBell()
615613
}
616614
}
617615

618616
private func moveRight(editState: EditState) throws {
619617
if editState.moveRight() {
620618
try self.updateCursorPos(editState: editState)
621-
} else {
622-
self.ringBell()
623619
}
624620
}
625621

@@ -658,8 +654,6 @@ public class LineReader {
658654
private func deleteCharacter(editState: EditState) throws {
659655
if editState.deleteCharacter() {
660656
try self.refreshLine(editState: editState)
661-
} else {
662-
self.ringBell()
663657
}
664658
}
665659

0 commit comments

Comments
 (0)