         self?.reloadHistory()
       }
     )
+    
+    let copyURLItem = NSMenuItem(
+      title: "Copy Link",
+      action: #selector(copyURL),
+      keyEquivalent: ""
+    )
+    copyURLItem.target = self
+    contextMenu.addItem(copyURLItem)
+    
+    table.menu = contextMenu
     
     reloadHistory()
   }

/// Manages the "Recent Episodes" window.
class RecentsController: NSWindowController {
  @IBOutlet private weak var table: NSTableView!
  
  private let downloadDateFormatter = DateFormatter()
  private let feedHelperProxy = FeedHelperProxy()

      NSLog("Catch doesn't know how to redownload: \(recentEpisode.url)")
    }
  }
  
  @IBAction func copyURL(_ sender: Any?) {
    let clickedRow = table.clickedRow
    
    guard clickedRow != -1 else { return }
    
    let recentEpisode = Defaults.shared.downloadHistory[clickedRow].episode
    NSPasteboard.general.clearContents()
    if #available(OSX 10.13, *) {
      NSPasteboard.general.setString(recentEpisode.url.absoluteString, forType: .URL)
    } else {
      NSPasteboard.general.setString(recentEpisode.url.absoluteString, forType: .string)
    }
  }
}
