MCPcopy Index your code
hub / github.com/python/cpython / handle_erase

Method handle_erase

Lib/getpass.py:322–330  ·  view source on GitHub ↗

Delete character before cursor (Backspace/DEL).

(self)

Source from the content-addressed store, hash-verified

320 self.refresh_display()
321
322 def handle_erase(self):
323 """Delete character before cursor (Backspace/DEL)."""
324 if self.cursor_pos == 0:
325 return
326 assert self.cursor_pos > 0
327 self.cursor_pos -= 1
328 prev_len = len(self.password)
329 del self.password[self.cursor_pos]
330 self.refresh_display(prev_len)
331
332 def handle_kill_line(self):
333 """Erase entire line (Ctrl+U)."""

Callers

nothing calls this directly

Calls 1

refresh_displayMethod · 0.95

Tested by

no test coverage detected