                    (eq process (get-buffer-process gud-comint-buffer)))
                (eq rdebug-window-configuration-state 'debugger)
                (not (eq (process-status process) 'run)))
-      (rdebug-set-window-configuration-state 'original)
-      (rdebug-display-original-window-configuration))))
+      (rdebug-set-window-configuration-state 'original))
+    ;; This unbinds the special debugger keys of the source buffers.
+    (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist)
+            rdebug-debugger-support-minor-mode-map-when-deactive)))
 
 ;; Fontification and keymaps for secondary buffers (breakpoints, stack)
 

(defun rdebug-display-original-window-configuration ()
  "Display the layout of windows prior to starting the ruby debugger."
  (interactive)
  (when rdebug-original-window-configuration
    (set-window-configuration rdebug-original-window-configuration)
    (rdebug-set-window-configuration-state 'original)
    (message
     "Type `M-x rdebug-restore-windows RET' to see debugger windows.")))

(defun rdebug-set-windows (&optional name)
  "Sets window used in multi-window frame and issues

      (set (make-local-variable 'gud-comint-buffer) comint-buffer)
      (insert "\

This is a rdebug secondary window, you can use it to watch a
number of help buffers. Use capital letters to switch between the
available buffers. Lower case letters (and other key
combinations) are used to issue buffer-specific commands.
